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

/* ═══════════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════════ */
:root {
  --bg:              #000000;
  --bg-1:            #080808;
  --bg-2:            #0f0f0f;
  --bg-3:            #141414;
  --bg-4:            #1a1a1a;
  --border:          rgba(255,255,255,0.07);
  --border-hover:    rgba(255,255,255,0.18);
  --border-focus:    rgba(255,255,255,0.35);

  --text:            #ffffff;
  --text-2:          #c8c8c8;
  --text-3:          #888888;
  --text-4:          #444444;

  /* Glow palette */
  --glow-xs:         0 0 8px  rgba(255,255,255,0.08);
  --glow-sm:         0 0 16px rgba(255,255,255,0.10), 0 0 40px rgba(255,255,255,0.04);
  --glow-md:         0 0 24px rgba(255,255,255,0.15), 0 0 60px rgba(255,255,255,0.06);
  --glow-lg:         0 0 40px rgba(255,255,255,0.20), 0 0 80px rgba(255,255,255,0.08);
  --glow-btn:        0 0 20px rgba(255,255,255,0.30), 0 0 50px rgba(255,255,255,0.10);

  /* Status */
  --green:           #52e87a;
  --red:             #ff5a5a;
  --yellow:          #ffd166;
  --purple:          #c084fc;

  /* Geometry */
  --r:               14px;
  --r-sm:            9px;
  --r-xs:            6px;
  --sidebar-w:       280px;

  /* Transitions */
  --t-fast:          0.12s ease;
  --t-med:           0.22s ease;
}

/* ═══════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; }

#app { min-height: 100vh; }

/* ═══════════════════════════════════════════════
   BACKGROUND — SLEEK STATIC DOT GRID
═══════════════════════════════════════════════ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
  transform: translateZ(0);
}

/* Vignette */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 80% 80% at 50% 50%, transparent 40%, rgba(0,0,0,0.75) 100%);
  pointer-events: none;
  z-index: 0;
  transform: translateZ(0);
}

/* ═══════════════════════════════════════════════
   LANDING PAGE
═══════════════════════════════════════════════ */
.landing {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px 80px;
  overflow: hidden;
}

/* large glow orb top-center */
.landing::before {
  content: '';
  position: absolute;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(255,255,255,0.055) 0%, transparent 60%);
  pointer-events: none;
  animation: orb-pulse 6s ease-in-out infinite;
}

@keyframes orb-pulse {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1);    }
  50%       { opacity: 1.0; transform: translateX(-50%) scale(1.07); }
}

/* Logo */
.landing .logo {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 28px;
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  margin-bottom: 32px;
  box-shadow: var(--glow-lg), inset 0 1px 0 rgba(255,255,255,0.08);
  animation: logo-float 4s ease-in-out infinite;
}

@keyframes logo-float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-8px) rotate(-1deg); }
  66%       { transform: translateY(-4px) rotate(1deg); }
}

/* Badge above title */
.landing-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.landing-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.landing h1 {
  font-size: clamp(36px, 6vw, 60px);
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1.05;
  margin-bottom: 6px;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.6) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing .landing-sub {
  font-size: clamp(14px, 2vw, 18px);
  color: var(--text-3);
  font-weight: 400;
  line-height: 1.6;
  max-width: 520px;
  margin-bottom: 40px;
}

/* Feature pills row */
.landing-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 720px;
  margin-top: 52px;
}

.feature-pill {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  cursor: default;
  transition: border-color var(--t-med), color var(--t-med), box-shadow var(--t-med);
}
.feature-pill:hover {
  border-color: rgba(255,255,255,0.22);
  color: var(--text);
  box-shadow: var(--glow-xs);
}

/* ═══════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--r-sm);
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--t-med), transform var(--t-fast), background var(--t-fast);
  letter-spacing: -0.2px;
}

/* shimmer effect on btn-primary */
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.15) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}
.btn-primary:hover::before { transform: translateX(100%); }

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: #ffffff;
  color: #000000;
  box-shadow: var(--glow-btn);
}
.btn-primary:hover {
  background: #efefef;
  box-shadow: 0 0 30px rgba(255,255,255,0.45), 0 0 70px rgba(255,255,255,0.15);
}

.btn-ghost {
  background: rgba(255,255,255,0.04);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.07);
  border-color: var(--border-hover);
  color: var(--text);
}

.btn-danger {
  background: rgba(255, 90, 90, 0.08);
  color: var(--red);
  border: 1px solid rgba(255,90,90,0.15);
}
.btn-danger:hover {
  background: rgba(255, 90, 90, 0.15);
  box-shadow: 0 0 14px rgba(255,90,90,0.12);
}

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-xs { padding: 5px 12px; font-size: 12px; }

/* ═══════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-active  { background: rgba(82,232,122,0.10); color: var(--green);  border: 1px solid rgba(82,232,122,0.15); }
.badge-invite  { background: rgba(255,255,255,0.06); color: var(--text-3); border: 1px solid var(--border); }
.badge-warning { background: rgba(255,209,102,0.10); color: var(--yellow); border: 1px solid rgba(255,209,102,0.15); }
.badge-danger  { background: rgba(255,90,90,0.10);   color: var(--red);    border: 1px solid rgba(255,90,90,0.15); }

/* ═══════════════════════════════════════════════
   SERVER SELECT
═══════════════════════════════════════════════ */
.server-select {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 60px 28px;
}

.server-select h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: 6px;
}
.server-select .sub {
  color: var(--text-3);
  margin-bottom: 36px;
  font-size: 14px;
}

.guild-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.guild-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 28px 20px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-med), box-shadow var(--t-med), transform var(--t-med), background var(--t-med);
  position: relative;
  overflow: hidden;
}
.guild-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.10), transparent);
}
.guild-card:hover {
  border-color: rgba(255,255,255,0.22);
  box-shadow: var(--glow-sm);
  transform: translateY(-4px);
  background: var(--bg-3);
}
.guild-card.disabled { opacity: 0.4; cursor: default; pointer-events: none; }

.guild-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 24px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.guild-icon img { width: 100%; height: 100%; object-fit: cover; }

.guild-name { font-weight: 700; font-size: 14px; }
.guild-meta { font-size: 11px; color: var(--text-4); }

/* ═══════════════════════════════════════════════
   DASHBOARD LAYOUT
═══════════════════════════════════════════════ */
.dash-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Sidebar ── */
/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: rgba(10, 10, 14, 0.96);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 12px 12px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden; /* Locked header & footer, only Nav scrolls */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-sizing: border-box;
}

/* Modern Sidebar Server Card */
.sidebar-server-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(18, 20, 32, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  text-decoration: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.sidebar-server-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}
.sidebar-server-card:hover {
  background: rgba(24, 27, 44, 0.95);
  border-color: rgba(88, 101, 242, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 16px rgba(88, 101, 242, 0.15);
}
.sidebar-guild-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.25), rgba(145, 70, 255, 0.25));
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-guild-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sidebar-guild-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sidebar-guild-name {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-guild-role-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.sidebar-switch-hint {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
  transition: color 0.15s ease, transform 0.15s ease;
}
.sidebar-server-card:hover .sidebar-switch-hint {
  color: #7289da;
  transform: translateX(2px);
}

/* Sidebar Search */
.sidebar-search {
  position: relative;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.sidebar-search input {
  width: 100%;
  background: rgba(18, 20, 32, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 9px 12px 9px 38px !important;
  color: #ffffff;
  font-size: 12.5px;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}
.sidebar-search input:focus {
  background: rgba(24, 27, 44, 0.9);
  border-color: rgba(88, 101, 242, 0.5);
  box-shadow: 0 0 16px rgba(88, 101, 242, 0.2);
}
.sidebar-search input::placeholder {
  color: var(--text-3);
  font-size: 12px;
}
.sidebar-search .search-icon-svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  flex-shrink: 0;
  display: block;
}

/* Scrollable Nav Container */
#sidebar-nav-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  margin-right: -4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}
#sidebar-nav-container::-webkit-scrollbar {
  width: 4px;
}
#sidebar-nav-container::-webkit-scrollbar-track {
  background: transparent;
}
#sidebar-nav-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
}
#sidebar-nav-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Navigation Groups */
.nav-group-wrap {
  margin-bottom: 10px;
}
.nav-group-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  padding: 12px 10px 6px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-group-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  color: #a1a1aa;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 2px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.nav-item-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.nav-item .icon-wrap {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  flex-shrink: 0;
  transition: transform var(--t-fast), background var(--t-fast);
}
.nav-item .label-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  transform: translateX(2px);
}
.nav-item:hover .icon-wrap {
  background: rgba(255, 255, 255, 0.09);
  transform: scale(1.08);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(88, 101, 242, 0.2) 0%, rgba(88, 101, 242, 0.06) 100%);
  color: #ffffff;
  font-weight: 700;
  border-color: rgba(88, 101, 242, 0.4);
  box-shadow: 0 2px 12px rgba(88, 101, 242, 0.15);
}
.nav-item.active .icon-wrap {
  background: rgba(88, 101, 242, 0.3);
}

.nav-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
.nav-badge-new {
  background: rgba(88, 101, 242, 0.2);
  color: #7289da;
  border: 1px solid rgba(88, 101, 242, 0.3);
}
.nav-badge-live {
  background: rgba(237, 66, 69, 0.2);
  color: #ff7675;
  border: 1px solid rgba(237, 66, 69, 0.3);
}

/* Presence Widget & Active Users */
.presence-widget {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: all var(--t-fast);
}
.presence-widget:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.presence-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  user-select: none;
}
.presence-header-left {
  display: flex;
  align-items: center;
  gap: 7px;
}
.presence-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.presence-dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #52e87a;
  box-shadow: 0 0 8px #52e87a;
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.presence-badge {
  font-size: 10px;
  font-weight: 700;
  color: #52e87a;
  background: rgba(82, 232, 122, 0.12);
  border: 1px solid rgba(82, 232, 122, 0.25);
  padding: 1px 6px;
  border-radius: 99px;
}

.presence-list {
  padding: 6px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.presence-user-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: background var(--t-fast);
}
.presence-user-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.presence-avatar-wrap, .user-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.presence-avatar-wrap img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  object-fit: cover;
}

.user-status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid #0a0a0e;
}
.status-online {
  background: #52e87a;
  box-shadow: 0 0 6px rgba(82, 232, 122, 0.8);
}
.status-idle {
  background: #ffd166;
  box-shadow: 0 0 6px rgba(255, 209, 102, 0.8);
}
.status-offline {
  background: #747f8d;
}

.presence-user-details {
  flex: 1;
  min-width: 0;
}
.presence-user-name {
  display: flex;
  align-items: center;
  gap: 4px;
}
.presence-user-name .name-text {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.presence-user-sub {
  font-size: 10px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.presence-section-name {
  color: var(--text-4);
}

/* Owner & Role Badges */
.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  padding: 1.5px 6px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.pill-owner {
  background: rgba(241, 196, 15, 0.12);
  color: #f1c40f;
  border: 1px solid rgba(241, 196, 15, 0.3);
}

.pill-dev {
  background: rgba(145, 70, 255, 0.12);
  color: #c084fc;
  border: 1px solid rgba(145, 70, 255, 0.3);
}

.pill-role {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Modern Unified User Control Bar */
.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(18, 20, 32, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--t-fast);
}

.sidebar-user-card:hover {
  background: rgba(24, 27, 44, 0.95);
  border-color: rgba(255, 255, 255, 0.12);
}

.sidebar-user-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}

.sidebar-user-avatar-wrap img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(88, 101, 242, 0.5);
  object-fit: cover;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
}

.status-live-indicator {
  color: #2ecc71;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sidebar-user-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 2px 5px;
  font-size: 11.5px;
  color: var(--text-3);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.sidebar-action-btn:hover {
  background: rgba(88, 101, 242, 0.2);
  color: #ffffff;
  border-color: rgba(88, 101, 242, 0.4);
}

.sidebar-action-btn.logout:hover {
  background: rgba(237, 66, 69, 0.2);
  color: #ff7b72;
  border-color: rgba(237, 66, 69, 0.4);
}

/* Presence Accordion (Active Team members) */
.presence-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.presence-bar-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  transition: all var(--t-fast);
}

.presence-bar-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.presence-bar-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.presence-dropdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  max-height: 140px;
  overflow-y: auto;
}

.server-select-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding: 12px 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--r);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.server-select-topbar .user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.server-select-topbar .user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.15);
  object-fit: cover;
}
.server-select-topbar .user-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: 1.5px solid rgba(255,255,255,0.15);
}
.server-select-topbar .user-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
}
.server-select-topbar .user-sub {
  font-size: 11px;
  color: var(--text-4);
}
.server-select-topbar .actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Main content area ── */
.main {
  flex: 1;
  min-width: 0;
  padding: 40px 48px 100px;
  max-width: 1040px;
}

/* ── Page header ── */
.page-header { margin-bottom: 32px; }
.page-header h1 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.5px;
}
.page-header p { color: var(--text-3); margin: 0; font-size: 13px; }

/* ═══════════════════════════════════════════════
   STAT CARDS
═══════════════════════════════════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px 18px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--t-med), box-shadow var(--t-med);
  cursor: default;
}
/* top shimmer line */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
}
/* subtle corner glow */
.stat-card::after {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
}
.stat-card:hover {
  border-color: rgba(255,255,255,0.14);
  box-shadow: var(--glow-sm);
}

.stat-card .value {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-card .stat-icon {
  font-size: 18px;
  margin-bottom: 10px;
  display: block;
}
.stat-card .value {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-card .label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Section headings */
.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 16px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
}
.section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ═══════════════════════════════════════════════
   MODULE CARDS (Overview)
═══════════════════════════════════════════════ */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.module-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  cursor: pointer;
  transition: border-color var(--t-med), box-shadow var(--t-med), transform var(--t-med), background var(--t-med);
  position: relative;
  overflow: hidden;
}
.module-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}
/* Arrow appear on hover */
.module-card::after {
  content: '→';
  position: absolute;
  bottom: 16px;
  right: 18px;
  font-size: 16px;
  color: var(--text-4);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity var(--t-med), transform var(--t-med);
}
.module-card:hover {
  border-color: rgba(255,255,255,0.16);
  box-shadow: var(--glow-sm);
  transform: translateY(-3px);
  background: var(--bg-3);
}
.module-card:hover::after { opacity: 1; transform: translateX(0); }

.module-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.module-card .icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 1px solid rgba(255,255,255,0.06);
}

.module-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 5px; }
.module-card p  { font-size: 12px; color: var(--text-3); line-height: 1.5; padding-right: 24px; }

/* ═══════════════════════════════════════════════
   TOGGLE SWITCH
═══════════════════════════════════════════════ */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  user-select: none;
}
.toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}
.toggle.on {
  background: #5865f2;
  border-color: #5865f2;
  box-shadow: 0 0 14px rgba(88, 101, 242, 0.5);
}
.toggle .knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  transition: left 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}
.toggle.on .knob {
  left: 23px;
  background: #ffffff;
}

/* ═══════════════════════════════════════════════
   BUILDER OPTION ROWS & CARDS
═══════════════════════════════════════════════ */
.builder-option-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.builder-option-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: all 0.15s ease;
}
.builder-option-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.14);
}

.builder-option-row.purple {
  background: rgba(145, 70, 255, 0.06);
  border-color: rgba(145, 70, 255, 0.25);
}
.builder-option-row.purple:hover {
  background: rgba(145, 70, 255, 0.1);
  border-color: rgba(145, 70, 255, 0.4);
}

.builder-option-row.pink {
  background: rgba(232, 121, 249, 0.06);
  border-color: rgba(232, 121, 249, 0.25);
}
.builder-option-row.pink:hover {
  background: rgba(232, 121, 249, 0.1);
  border-color: rgba(232, 121, 249, 0.4);
}

.builder-option-row.danger {
  background: rgba(237, 66, 69, 0.06);
  border-color: rgba(237, 66, 69, 0.25);
}
.builder-option-row.danger:hover {
  background: rgba(237, 66, 69, 0.1);
  border-color: rgba(237, 66, 69, 0.4);
}

.builder-row-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.builder-icon {
  font-size: 22px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.builder-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.builder-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.builder-desc {
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════
   SETTINGS CARDS & FORMS
═══════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════
   MODERN FORM SYSTEM & LAYOUT GRIDS
═══════════════════════════════════════════════ */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 960px) {
  .grid-2col {
    grid-template-columns: 1fr;
  }
}

.grid-3col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

/* Card Structure */
.card {
  background: rgba(18, 20, 32, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r);
  padding: 22px 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.2px;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Form Groups & Labels */
.form-group, .field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
  width: 100%;
}

.form-group label, .field label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #e4e4e7;
  letter-spacing: 0.02em;
  margin: 0;
  user-select: none;
}

/* Inputs, Selects & Textareas */
.input, input[type="text"], input[type="url"], input[type="number"], input[type="date"], input[type="time"],
.select, select,
.textarea, textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  padding: 10px 14px !important;
  border-radius: 10px !important;
  font-size: 13.5px !important;
  font-family: inherit !important;
  outline: none !important;
  transition: all 0.15s ease !important;
  box-sizing: border-box !important;
}

.input::placeholder, .textarea::placeholder {
  color: var(--text-4);
}

.input:hover, .select:hover, select:hover, .textarea:hover, textarea:hover {
  border-color: rgba(255, 255, 255, 0.2) !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

.input:focus, .select:focus, select:focus, .textarea:focus, textarea:focus {
  border-color: #5865f2 !important;
  background: rgba(255, 255, 255, 0.07) !important;
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.25), 0 0 16px rgba(88, 101, 242, 0.15) !important;
}

.select, select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  padding-right: 38px !important;
  cursor: pointer;
}

.select option, select option {
  background: #121420 !important;
  color: #ffffff !important;
  padding: 8px 12px !important;
}

.textarea, textarea {
  resize: vertical;
  min-height: 85px;
  line-height: 1.55;
}

/* Switch & Slider */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 99px;
  transition: 0.2s ease;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
input:checked + .slider {
  background-color: #5865f2;
  border-color: #5865f2;
  box-shadow: 0 0 12px rgba(88, 101, 242, 0.45);
}
input:checked + .slider:before {
  transform: translateX(20px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  outline: none;
  transition: all 0.15s ease;
  user-select: none;
}
.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #5865f2, #4752c4);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(88, 101, 242, 0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #6875f5, #5865f2);
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #e4e4e7;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: linear-gradient(135deg, #f87171, #ef4444);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 8px;
}

/* Chips */
.chip-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.chip {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.chip .x { cursor: pointer; color: var(--text-4); font-size: 13px; line-height: 1; }
.chip .x:hover { color: var(--red); }

/* Save bar */
.save-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 0 4px;
  background: linear-gradient(to top, var(--bg) 60%, transparent);
  backdrop-filter: blur(2px);
}

/* ═══════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--bg-3);
  border: 1px solid rgba(255,255,255,0.10);
  border-left: 3px solid var(--green);
  padding: 13px 22px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 12px 40px rgba(0,0,0,0.7), var(--glow-xs);
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 9999;
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }

/* ═══════════════════════════════════════════════
   DATA TABLES
═══════════════════════════════════════════════ */
table.data-table { width: 100%; border-collapse: collapse; }
table.data-table thead tr {
  border-bottom: 1px solid var(--border);
}
table.data-table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  padding: 10px 14px;
  font-weight: 700;
}
table.data-table td {
  padding: 13px 14px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tbody tr { transition: background var(--t-fast); }
table.data-table tbody tr:hover td { background: rgba(255,255,255,0.025); }

.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell img {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.07);
}

.rank-badge {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--text-4);
}

/* ═══════════════════════════════════════════════
   EMPTY STATE & LOADING
═══════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-4);
}
.empty-state .big { font-size: 40px; margin-bottom: 14px; }
.empty-state p { font-size: 14px; }

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  color: var(--text-4);
  font-size: 14px;
  gap: 12px;
}

.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.06);
  border-top-color: rgba(255,255,255,0.6);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  box-shadow: 0 0 10px rgba(255,255,255,0.08);
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════
   SECTION COLOR BAR / DIVIDERS
═══════════════════════════════════════════════ */
.section-color-bar {
  width: 3px; border-radius: 3px; height: 16px;
  display: inline-block; margin-right: 8px; vertical-align: middle;
  background: rgba(255,255,255,0.4);
  box-shadow: 0 0 8px rgba(255,255,255,0.25);
}

/* ═══════════════════════════════════════════════
   FILTER BAR / CHAT LOGS
═══════════════════════════════════════════════ */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.filter-bar select.input { max-width: 220px; }
.filter-bar input.input { flex: 1; min-width: 200px; }

.channel-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-3);
  padding: 3px 9px;
  border-radius: var(--r-xs);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

table.log-table td { vertical-align: top; padding-top: 14px; }
.log-time { white-space: nowrap; color: var(--text-4); font-size: 11px; }
.log-content { white-space: pre-wrap; word-break: break-word; max-width: 460px; font-size: 13px; }
.log-old-content {
  white-space: pre-wrap; word-break: break-word;
  max-width: 460px; text-decoration: line-through;
  color: var(--text-4); font-size: 12px; margin-bottom: 4px;
}
.log-attachments { margin-top: 6px; font-size: 12px; }
.log-attachments a { color: var(--text-3); text-decoration: underline; }
.log-attachments a:hover { color: var(--text); }

/* ═══════════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════════ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-top: 22px;
  font-size: 13px;
  color: var(--text-3);
}
.pagination button {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 6px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.pagination button:hover { border-color: var(--border-hover); background: var(--bg-3); }

/* ═══════════════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════════════ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.07); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); }

/* ═══════════════════════════════════════════════
   MOBILE TOPBAR & BACKDROP
═══════════════════════════════════════════════ */
.mobile-topbar {
  display: none;
}
.sidebar-backdrop {
  display: none;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE (TABLETS & SMARTPHONES)
═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Mobile Sticky Topbar */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: 58px;
    padding: 0 16px;
    background: rgba(8, 8, 8, 0.95);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 900;
  }

  .mobile-menu-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    width: 38px;
    height: 38px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--t-fast);
  }
  .mobile-menu-btn:active { background: rgba(255, 255, 255, 0.12); }

  .mobile-guild-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 60%;
  }
  .mobile-guild-info .guild-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 11px;
    flex-shrink: 0;
  }
  .mobile-guild-info .name {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .switch-btn-mobile {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-3);
    width: 38px;
    height: 38px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--t-fast);
  }
  .switch-btn-mobile:hover { color: var(--text); }

  /* Backdrop Overlay */
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  /* Sliding Drawer Sidebar */
  .dash-layout {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 82vw;
    height: 100vh;
    z-index: 999;
    background: #0a0a0a;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sidebar.open {
    transform: translateX(0);
  }

  /* Main Content Adjustments */
  .main {
    padding: 20px 16px 80px;
    max-width: 100%;
  }

  .page-header h1 {
    font-size: 20px;
  }

  /* Grids & Cards */
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .module-grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 18px 16px;
  }

  /* Tables horizontal scrolling on mobile */
  .table-wrap, table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Form Actions */
  .form-actions {
    flex-direction: column-reverse;
    gap: 10px;
  }
  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .landing h1 {
    font-size: 32px;
    letter-spacing: -1px;
  }
}

/* ═══════════════════════════════════════════════
   SERVER SELECTION PAGE
═══════════════════════════════════════════════ */
.server-select-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 40px 24px 100px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.server-select-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: rgba(18, 20, 32, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.server-select-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.server-select-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(88, 101, 242, 0.5);
  box-shadow: 0 0 12px rgba(88, 101, 242, 0.3);
}

.server-select-avatar-fallback {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.server-select-username {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.server-select-tag {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.server-select-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.server-select-hero {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.server-select-hero h1 {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.8px;
  color: #ffffff;
  margin: 0;
}

.server-select-hero p {
  font-size: 14px;
  color: var(--text-3);
  margin: 0;
}

.guild-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.guild-card {
  background: rgba(18, 20, 32, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.guild-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.guild-card:hover {
  transform: translateY(-5px);
  border-color: rgba(88, 101, 242, 0.5);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55), 0 0 24px rgba(88, 101, 242, 0.25);
  background: rgba(24, 27, 44, 0.95);
}

.guild-card.disabled {
  opacity: 0.75;
  border-style: dashed;
}
.guild-card.disabled:hover {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.guild-icon {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.2), rgba(145, 70, 255, 0.2));
  border: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.guild-card:hover .guild-icon {
  transform: scale(1.05);
  border-color: rgba(88, 101, 242, 0.8);
}

.guild-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guild-name {
  font-size: 15.5px;
  font-weight: 800;
  color: #ffffff;
  margin-top: 14px;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.guild-role-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.guild-role-pill.owner {
  background: rgba(241, 196, 15, 0.12);
  color: #f1c40f;
  border: 1px solid rgba(241, 196, 15, 0.3);
}

.guild-role-pill.admin {
  background: rgba(145, 70, 255, 0.12);
  color: #c084fc;
  border: 1px solid rgba(145, 70, 255, 0.3);
}

.guild-role-pill.member {
  background: rgba(255, 255, 255, 0.05);
  color: #a1a1aa;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.guild-footer {
  width: 100%;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-3);
}

.guild-footer .member-count {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}

.guild-footer .online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 6px #2ecc71;
}

.guild-btn-action {
  font-size: 12px;
  font-weight: 700;
  color: #7289da;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease, transform 0.15s ease;
}

.guild-card:hover .guild-btn-action {
  color: #ffffff;
  transform: translateX(2px);
}

/* ═══════════════════════════════════════════════
   UTILITY ANIMATIONS
═══════════════════════════════════════════════ */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.main { animation: fade-in-up 0.3s ease both; }

/* stagger children of stat-grid and module-grid */
.stat-card, .module-card, .guild-card {
  animation: fade-in-up 0.35s ease both;
}
.stat-card:nth-child(1), .module-card:nth-child(1), .guild-card:nth-child(1) { animation-delay: 0.03s; }
.stat-card:nth-child(2), .module-card:nth-child(2), .guild-card:nth-child(2) { animation-delay: 0.07s; }
.stat-card:nth-child(3), .module-card:nth-child(3), .guild-card:nth-child(3) { animation-delay: 0.11s; }
.stat-card:nth-child(4), .module-card:nth-child(4), .guild-card:nth-child(4) { animation-delay: 0.15s; }
/* ═══════════════════════════════════════════════
   MODAL & BACKDROP
═══════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modal-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-card {
  background: #1e1f22;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(145, 70, 255, 0.15);
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #232428;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #232428;
}


