/* ===================================================
   FLUXY DASHBOARD Made by VALFX
   =================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root, [data-theme="dark"] {
  --bg-primary: #0b0d12;
  --bg-secondary: #11141b;
  --bg-card: rgba(22, 27, 38, 0.75);
  --bg-card-hover: rgba(30, 36, 50, 0.85);
  --bg-sidebar: #0f1118;
  --bg-input: rgba(22, 27, 38, 0.9);
  --border: rgba(220, 38, 38, 0.12);
  --border-hover: rgba(220, 38, 38, 0.3);
  --accent: #dc2626;
  --accent-glow: rgba(220, 38, 38, 0.35);
  --accent-light: #f87171;
  --accent-dark: #991b1b;
  --green: #43b581;
  --green-glow: rgba(67, 181, 129, 0.3);
  --red: #f04747;
  --orange: #faa61a;
  --pink: #eb459e;
  --blue: #5865f2;
  --gold: #f5c542;
  --text-primary: #e2e5ea;
  --text-secondary: #8b92a0;
  --text-muted: #565d6e;
  --radius: 14px;
  --radius-sm: 8px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 240px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme="light"] {
  --bg-primary: #f5f6fa;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(245, 245, 250, 0.95);
  --bg-sidebar: #ffffff;
  --bg-input: rgba(240, 240, 245, 0.9);
  --border: rgba(220, 38, 38, 0.15);
  --border-hover: rgba(220, 38, 38, 0.35);
  --accent: #dc2626;
  --accent-glow: rgba(220, 38, 38, 0.2);
  --accent-light: #ef4444;
  --text-primary: #1a1a2e;
  --text-secondary: #5a5f72;
  --text-muted: #8b92a0;
}

html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 99px; }

.login-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
}
.login-overlay.hidden { display: none; }
.login-card {
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 360px;
  backdrop-filter: blur(16px);
}
.login-brand {
  width: 56px; height: 56px; font-size: 1.6rem;
  margin: 0 auto 16px;
}
.login-card h2 { margin-bottom: 6px; }
.login-card > p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 24px; }
#login-form { display: flex; flex-direction: column; gap: 12px; }
#login-form input {
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition);
}
#login-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.login-error { color: var(--red); font-size: 0.85rem; }

.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform var(--transition), background var(--transition);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 24px 20px 16px; }
.brand-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), #b91c1c);
  border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.15rem; color: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
}
.brand-text {
  font-weight: 700; font-size: 1.2rem; letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; overflow-y: auto; }
.nav-divider { height: 1px; background: var(--border); margin: 8px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border: none; background: none;
  color: var(--text-secondary); font-family: var(--font);
  font-size: 0.88rem; font-weight: 500;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all var(--transition);
  position: relative; text-align: left; width: 100%;
}
.nav-item:hover { color: var(--text-primary); background: rgba(220, 38, 38, 0.08); }
.nav-item.active { color: #fff; background: rgba(220, 38, 38, 0.15); }
[data-theme="light"] .nav-item.active { color: var(--accent); }
.nav-item.active::before {
  content: ''; position: absolute; left: -10px;
  top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--accent); border-radius: 0 4px 4px 0;
  box-shadow: 0 0 8px var(--accent-glow);
}
.sidebar-footer {
  padding: 12px 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.8rem; color: var(--text-muted);
}
.sidebar-footer-left { display: flex; align-items: center; gap: 8px; }
.sidebar-footer-right { display: flex; align-items: center; gap: 6px; }
.status-dot {
  width: 8px; height: 8px; background: var(--green); border-radius: 50%;
  box-shadow: 0 0 8px var(--green-glow); animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.theme-toggle, .logout-btn {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 4px; display: grid; place-items: center;
  border-radius: 6px; transition: all var(--transition);
}
.theme-toggle:hover, .logout-btn:hover { color: var(--accent); background: rgba(220, 38, 38, 0.08); }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

.mobile-header {
  display: none; position: fixed; top: 0; left: 0; right: 0;
  height: 56px; background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  align-items: center; gap: 12px; padding: 0 16px; z-index: 90;
}
.menu-toggle { background: none; border: none; color: var(--text-primary); cursor: pointer; padding: 4px; display: grid; place-items: center; }
.mobile-title { font-weight: 600; font-size: 1rem; }

.main-content {
  margin-left: var(--sidebar-width); flex: 1;
  padding: 32px 36px; min-height: 100vh; position: relative;
  transition: background var(--transition);
}
.loading-overlay {
  position: absolute; inset: 0; background: var(--bg-primary);
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 20px; z-index: 50;
  transition: opacity 0.4s ease;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.spinner {
  width: 40px; height: 40px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay p { color: var(--text-secondary); font-size: 0.95rem; }
.error-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 80px 20px; text-align: center; }
.error-state.hidden { display: none; }
.error-icon { font-size: 3rem; }
.error-state h2 { color: var(--text-primary); }
.error-state p { color: var(--text-secondary); max-width: 400px; }

.page { display: none; animation: fadeUp 0.35s ease; }
.page.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.5px; }
.page-header-actions { display: flex; gap: 8px; }

.btn-icon {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); padding: 8px 10px;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all var(--transition); display: grid; place-items: center;
}
.btn-icon:hover { color: var(--accent); border-color: var(--border-hover); box-shadow: 0 0 12px var(--accent-glow); }

.btn-primary {
  padding: 10px 24px; background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm); font-family: var(--font);
  font-weight: 600; cursor: pointer; transition: all var(--transition);
}
.btn-primary:hover { box-shadow: 0 4px 20px var(--accent-glow); transform: translateY(-1px); }
.btn-secondary {
  padding: 10px 24px; background: var(--bg-card); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font); font-weight: 600; cursor: pointer; transition: all var(--transition);
}
.btn-secondary:hover { border-color: var(--border-hover); }
.btn-danger { padding: 10px 24px; background: var(--red); color: #fff; border: none; border-radius: var(--radius-sm); font-family: var(--font); font-weight: 600; cursor: pointer; }
.btn-sm { padding: 5px 12px; font-size: 0.75rem; }

.hidden { display: none !important; }

.server-card { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); margin-bottom: 24px; background: var(--bg-card); }
.server-card-bg { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(220, 38, 38, 0.18), rgba(185, 28, 28, 0.08)); background-size: cover; background-position: center; }
.server-card-content { position: relative; display: flex; align-items: center; gap: 20px; padding: 28px 32px; }
.server-icon { width: 72px; height: 72px; border-radius: 50%; border: 3px solid var(--accent); box-shadow: 0 0 20px var(--accent-glow); object-fit: cover; background: var(--bg-secondary); }
.server-info h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
.server-desc { color: var(--text-secondary); font-size: 0.9rem; max-width: 500px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card); backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; align-items: center; gap: 14px;
  transition: all var(--transition);
}
.stat-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.15); }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.stat-icon.red    { background: rgba(220, 38, 38, 0.15); color: var(--accent); }
.stat-icon.green  { background: rgba(67, 181, 129, 0.15); color: var(--green); }
.stat-icon.blue   { background: rgba(88, 101, 242, 0.15); color: var(--blue); }
.stat-icon.orange { background: rgba(250, 166, 26, 0.15); color: var(--orange); }
.stat-icon.pink   { background: rgba(235, 69, 158, 0.15); color: var(--pink); }
.stat-icon.gold   { background: rgba(245, 197, 66, 0.15); color: var(--gold); }
.stat-data { display: flex; flex-direction: column; }
.stat-value { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.5px; }
.stat-label { font-size: 0.76rem; color: var(--text-secondary); margin-top: 2px; }

.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.detail-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.detail-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 14px; }
.detail-list { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.detail-list li { display: flex; justify-content: space-between; align-items: center; }
.detail-key { color: var(--text-secondary); font-size: 0.86rem; }
.detail-val { font-weight: 500; font-size: 0.86rem; }
.features-list { display: flex; flex-wrap: wrap; gap: 8px; }
.feature-tag { padding: 5px 12px; background: rgba(220, 38, 38, 0.1); border: 1px solid rgba(220, 38, 38, 0.2); border-radius: 20px; font-size: 0.73rem; font-weight: 500; color: var(--accent-light); text-transform: capitalize; }

.search-box { display: flex; align-items: center; gap: 8px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 14px; transition: border-color var(--transition); }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search-box svg { color: var(--text-muted); flex-shrink: 0; }
.search-box input { background: none; border: none; outline: none; color: var(--text-primary); font-family: var(--font); font-size: 0.88rem; width: 200px; }
.search-box input::placeholder { color: var(--text-muted); }
.member-count { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 14px; }
.members-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.member-card { display: flex; align-items: center; gap: 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; transition: all var(--transition); }
.member-card:hover { border-color: var(--border-hover); background: var(--bg-card-hover); transform: translateY(-1px); }
.member-avatar-wrap { position: relative; flex-shrink: 0; }
.member-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--bg-secondary); }
.member-status-dot { position: absolute; bottom: 0; right: 0; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--bg-card); }
.member-status-dot.online { background: var(--green); }
.member-status-dot.idle { background: var(--orange); }
.member-status-dot.dnd { background: var(--red); }
.member-status-dot.offline { background: var(--text-muted); }
.member-info { flex: 1; min-width: 0; }
.member-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-roles { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.member-role-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.member-bot-tag { padding: 1px 6px; background: rgba(88, 101, 242, 0.2); border-radius: 4px; font-size: 0.63rem; font-weight: 600; color: var(--blue); text-transform: uppercase; letter-spacing: 0.5px; margin-left: 6px; }
.member-actions { display: flex; gap: 4px; opacity: 0; transition: opacity var(--transition); }
.member-card:hover .member-actions { opacity: 1; }
.action-btn { background: none; border: 1px solid var(--border); color: var(--text-muted); padding: 4px 6px; border-radius: 4px; cursor: pointer; font-size: 0.7rem; transition: all var(--transition); display: grid; place-items: center; }
.action-btn:hover { color: var(--red); border-color: var(--red); }
.action-btn.kick:hover { color: var(--orange); border-color: var(--orange); }

.channels-container { display: flex; flex-direction: column; gap: 20px; }
.channel-category { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.category-header { padding: 12px 18px; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); background: rgba(220, 38, 38, 0.05); border-bottom: 1px solid var(--border); }
.channel-item { display: flex; align-items: center; gap: 10px; padding: 9px 18px; color: var(--text-secondary); font-size: 0.88rem; transition: background var(--transition); }
.channel-item:hover { background: rgba(255,255,255,0.02); }
.channel-item + .channel-item { border-top: 1px solid rgba(255,255,255,0.03); }
.channel-icon { color: var(--text-muted); flex-shrink: 0; }
.channel-type-badge { margin-left: auto; padding: 2px 8px; border-radius: 4px; font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.channel-type-badge.text   { background: rgba(88, 101, 242, 0.15); color: var(--blue); }
.channel-type-badge.voice  { background: rgba(67, 181, 129, 0.15); color: var(--green); }
.channel-type-badge.forum  { background: rgba(250, 166, 26, 0.15); color: var(--orange); }
.channel-type-badge.announcement { background: rgba(235, 69, 158, 0.15); color: var(--pink); }
.channel-type-badge.stage  { background: rgba(245, 197, 66, 0.15); color: var(--gold); }

.roles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.role-card { display: flex; align-items: center; gap: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; transition: all var(--transition); }
.role-card:hover { border-color: var(--border-hover); transform: translateY(-1px); }
.role-color { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 8px rgba(0,0,0,0.3); }
.role-name { font-weight: 600; font-size: 0.9rem; flex: 1; }
.role-position { color: var(--text-muted); font-size: 0.73rem; }

.emojis-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.emoji-card { display: flex; flex-direction: column; align-items: center; gap: 8px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 10px; transition: all var(--transition); }
.emoji-card:hover { border-color: var(--border-hover); transform: translateY(-2px) scale(1.04); }
.emoji-card img { width: 38px; height: 38px; object-fit: contain; }
.emoji-card span { font-size: 0.7rem; color: var(--text-secondary); text-align: center; word-break: break-all; }

.sub-section { margin-bottom: 28px; }
.sub-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 14px; }
.top-inviters { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 8px; }
.inviter-card { display: flex; align-items: center; gap: 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; transition: all var(--transition); }
.inviter-card:hover { border-color: var(--border-hover); }
.inviter-rank { font-size: 1.2rem; font-weight: 800; color: var(--accent); min-width: 28px; }
.inviter-rank.gold { color: var(--gold); }
.inviter-rank.silver { color: #c0c0c0; }
.inviter-rank.bronze { color: #cd7f32; }
.inviter-name { font-weight: 600; font-size: 0.9rem; flex: 1; }
.inviter-count { font-weight: 700; color: var(--accent-light); font-size: 0.9rem; }

.invites-list { display: flex; flex-direction: column; gap: 8px; }
.invite-card { display: flex; align-items: center; gap: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; transition: all var(--transition); }
.invite-card:hover { border-color: var(--border-hover); }
.invite-code { font-weight: 700; font-size: 0.95rem; color: var(--accent-light); font-family: 'Courier New', monospace; }
.invite-meta { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.invite-meta span { font-size: 0.8rem; color: var(--text-secondary); }
.invite-uses { padding: 4px 12px; background: rgba(220, 38, 38, 0.1); border-radius: 20px; font-size: 0.76rem; font-weight: 600; color: var(--accent-light); }

.bans-list { display: flex; flex-direction: column; gap: 8px; }
.ban-card { display: flex; align-items: center; gap: 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 18px; transition: all var(--transition); }
.ban-card:hover { border-color: rgba(240, 71, 71, 0.3); }
.ban-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--bg-secondary); }
.ban-info { flex: 1; }
.ban-name { font-weight: 600; font-size: 0.88rem; }
.ban-reason { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.ban-unban { background: none; border: 1px solid var(--green); color: var(--green); padding: 4px 12px; border-radius: var(--radius-sm); font-size: 0.73rem; font-weight: 600; cursor: pointer; transition: all var(--transition); }
.ban-unban:hover { background: var(--green); color: #fff; }

.select-filter {
  padding: 8px 14px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-family: var(--font); font-size: 0.85rem; outline: none; cursor: pointer;
}
.audit-list { display: flex; flex-direction: column; gap: 8px; }
.audit-entry { display: flex; align-items: flex-start; gap: 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; }
.audit-entry:hover { border-color: var(--border-hover); }
.audit-action { font-weight: 600; font-size: 0.88rem; color: var(--text-primary); }
.audit-user { font-size: 0.8rem; color: var(--accent-light); }
.audit-target { font-size: 0.8rem; color: var(--text-secondary); }
.audit-time { font-size: 0.73rem; color: var(--text-muted); margin-top: 4px; }
.audit-badge { padding: 2px 8px; border-radius: 4px; font-size: 0.68rem; font-weight: 600; text-transform: uppercase; margin-right: 8px; flex-shrink: 0; }
.audit-badge.create { background: rgba(67, 181, 129, 0.15); color: var(--green); }
.audit-badge.update { background: rgba(88, 101, 242, 0.15); color: var(--blue); }
.audit-badge.delete { background: rgba(240, 71, 71, 0.15); color: var(--red); }

.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 14px; }
.chart-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.chart-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 14px; }
.chart-card canvas { max-height: 220px; }

.webhooks-list { display: flex; flex-direction: column; gap: 10px; }
.webhook-card { display: flex; align-items: center; gap: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; transition: all var(--transition); }
.webhook-card:hover { border-color: var(--border-hover); }
.webhook-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--bg-secondary); }
.webhook-info { flex: 1; }
.webhook-name { font-weight: 600; font-size: 0.9rem; }
.webhook-channel { font-size: 0.8rem; color: var(--text-secondary); }
.webhook-delete { background: none; border: 1px solid var(--red); color: var(--red); padding: 4px 12px; border-radius: var(--radius-sm); font-size: 0.73rem; font-weight: 600; cursor: pointer; transition: all var(--transition); }
.webhook-delete:hover { background: var(--red); color: #fff; }

.perm-container { display: flex; flex-direction: column; gap: 18px; }
.perm-select { width: 300px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.perm-item { display: flex; align-items: center; justify-content: space-between; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 16px; font-size: 0.85rem; }
.perm-name { color: var(--text-secondary); }
.perm-check { font-weight: 700; }
.perm-check.granted { color: var(--green); }
.perm-check.denied { color: var(--red); }

.scheduled-form { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.scheduled-form h3 { margin-bottom: 14px; font-size: 1rem; }
#scheduled-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
#scheduled-form select, #scheduled-form textarea, #scheduled-form input[type="datetime-local"] {
  padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary); font-family: var(--font);
  font-size: 0.88rem; outline: none;
}
#scheduled-form select { min-width: 200px; }
#scheduled-form textarea { flex: 1; min-width: 250px; resize: vertical; }
#scheduled-form input[type="datetime-local"] { min-width: 200px; }
.scheduled-list { display: flex; flex-direction: column; gap: 8px; }
.sched-card { display: flex; align-items: center; gap: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; }
.sched-card:hover { border-color: var(--border-hover); }
.sched-channel { font-weight: 600; font-size: 0.88rem; color: var(--accent-light); min-width: 120px; }
.sched-msg { flex: 1; font-size: 0.85rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-time { font-size: 0.78rem; color: var(--text-muted); min-width: 140px; }
.sched-status { padding: 2px 10px; border-radius: 10px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; }
.sched-status.pending { background: rgba(250, 166, 26, 0.15); color: var(--orange); }
.sched-status.sent { background: rgba(67, 181, 129, 0.15); color: var(--green); }
.sched-status.failed { background: rgba(240, 71, 71, 0.15); color: var(--red); }

.activity-feed {
  position: fixed; right: 0; top: 0; bottom: 0; width: 320px;
  background: var(--bg-sidebar); border-left: 1px solid var(--border);
  z-index: 110; display: flex; flex-direction: column;
  transition: transform var(--transition);
}
.activity-feed.hidden { transform: translateX(100%); display: flex !important; }
.activity-feed-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 14px; border-bottom: 1px solid var(--border); }
.activity-feed-header h3 { font-size: 1rem; font-weight: 600; }
.activity-close { background: none; border: none; color: var(--text-muted); font-size: 1.4rem; cursor: pointer; }
.activity-feed-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.activity-item { padding: 10px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.82rem; }
.activity-item .activity-type { font-weight: 600; color: var(--accent-light); font-size: 0.73rem; text-transform: uppercase; margin-bottom: 2px; }
.activity-item .activity-desc { color: var(--text-secondary); }
.activity-item .activity-time { color: var(--text-muted); font-size: 0.7rem; margin-top: 4px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal-overlay.hidden { display: none; }
.modal-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; width: 400px; max-width: 90vw; }
.modal-card h3 { margin-bottom: 8px; }
.modal-card p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 16px; }
.modal-card input { width: 100%; padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-family: var(--font); outline: none; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-state p { font-size: 0.9rem; }
.empty-icon { font-size: 2.5rem; margin-bottom: 12px; }

.chart-empty {
  text-align: center; padding: 40px 20px; color: var(--text-muted);
}
.chart-empty .empty-icon { font-size: 2rem; margin-bottom: 8px; }
.chart-empty p { font-size: 0.85rem; margin: 4px 0; }

.lb-list { display: flex; flex-direction: column; gap: 8px; }
.lb-entry {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 20px;
  transition: all var(--transition);
}
.lb-entry:hover { border-color: var(--border-hover); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.lb-entry.lb-top { border-color: rgba(220,38,38,0.2); }
.lb-entry.lb-rank-1 { background: linear-gradient(135deg, rgba(245,197,66,0.08), rgba(245,197,66,0.02)); border-color: rgba(245,197,66,0.25); }
.lb-entry.lb-rank-2 { background: linear-gradient(135deg, rgba(192,192,192,0.08), rgba(192,192,192,0.02)); border-color: rgba(192,192,192,0.2); }
.lb-entry.lb-rank-3 { background: linear-gradient(135deg, rgba(205,127,50,0.08), rgba(205,127,50,0.02)); border-color: rgba(205,127,50,0.2); }

.lb-rank { font-size: 1.3rem; font-weight: 800; min-width: 38px; text-align: center; color: var(--text-muted); }
.lb-entry.lb-rank-1 .lb-rank { color: var(--gold); text-shadow: 0 0 12px rgba(245,197,66,0.4); }
.lb-entry.lb-rank-2 .lb-rank { color: #c0c0c0; text-shadow: 0 0 12px rgba(192,192,192,0.4); }
.lb-entry.lb-rank-3 .lb-rank { color: #cd7f32; text-shadow: 0 0 12px rgba(205,127,50,0.4); }

.lb-user-info { flex: 1; min-width: 0; }
.lb-name { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-stats-row { display: flex; gap: 6px; margin-top: 4px; }
.lb-badge {
  padding: 1px 8px; border-radius: 10px; font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.lb-badge.lb-level { background: rgba(220,38,38,0.12); color: var(--accent-light); }
.lb-badge.lb-msgs { background: rgba(88,101,242,0.12); color: var(--blue); }

.lb-xp-col { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 140px; }
.lb-xp-text { font-weight: 700; font-size: 0.88rem; color: var(--text-primary); }
.lb-progress {
  width: 100%; height: 6px; background: rgba(255,255,255,0.06);
  border-radius: 3px; overflow: hidden;
}
[data-theme="light"] .lb-progress { background: rgba(0,0,0,0.06); }
.lb-progress-bar {
  height: 100%; border-radius: 3px; transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
}
.lb-progress.voice .lb-progress-bar,
.lb-progress-bar.voice {
  background: linear-gradient(90deg, var(--green), #2ecc71);
}

.nav-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-muted); padding: 14px 14px 6px; }

.form-tabs { display: flex; gap: 2px; margin-bottom: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; }
.tab-btn { flex: 1; padding: 9px 14px; background: none; border: none; color: var(--text-secondary); font-family: var(--font); font-size: 0.82rem; font-weight: 500; cursor: pointer; border-radius: 6px; transition: all var(--transition); }
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { background: var(--accent); color: #fff; }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeUp 0.3s ease; }

.form-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.form-card h3 { margin-bottom: 14px; font-size: 1rem; }
.form-card form { display: flex; flex-direction: column; gap: 10px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 120px; }
.form-warning-text { color: var(--orange); font-size: 0.82rem; margin-bottom: 8px; }

.input-field {
  padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary); font-family: var(--font);
  font-size: 0.88rem; outline: none; width: 100%; transition: border-color var(--transition);
}
.input-field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
textarea.input-field { resize: vertical; }
.input-color { width: 46px; height: 40px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: var(--bg-input); flex: 0 0 46px; }

.toggle-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.9rem; padding: 6px 0; }
.toggle-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

.embed-preview { border-left: 4px solid var(--accent); background: rgba(0,0,0,0.2); border-radius: 4px; padding: 14px; margin-top: 10px; }
.embed-preview h4 { font-size: 0.95rem; margin-bottom: 6px; }
.embed-preview p { font-size: 0.85rem; color: var(--text-secondary); }
.embed-field { margin-top: 8px; }
.embed-field-row { display: flex; gap: 8px; align-items: center; }
.embed-field-row input { flex: 1; }

.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 500; color: #fff; animation: slideIn 0.3s ease; min-width: 250px; box-shadow: 0 4px 20px rgba(0,0,0,0.3); display: flex; align-items: center; gap: 8px; }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.toast.info { background: var(--blue); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.gw-card { display: flex; align-items: center; gap: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 8px; }
.gw-card .gw-prize { font-weight: 600; font-size: 0.9rem; flex: 1; }
.gw-card .gw-status { padding: 3px 10px; border-radius: 10px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; }
.gw-status.active { background: rgba(67,181,129,0.15); color: var(--green); }
.gw-status.ended { background: rgba(88,101,242,0.15); color: var(--blue); }
.gw-status.failed { background: rgba(240,71,71,0.15); color: var(--red); }

.ticket-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 8px; }
.ticket-card:hover { border-color: var(--border-hover); }
.ticket-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ticket-subject { font-weight: 600; font-size: 0.92rem; }
.ticket-status { padding: 2px 10px; border-radius: 10px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; }
.ticket-status.open { background: rgba(67,181,129,0.15); color: var(--green); }
.ticket-status.closed { background: rgba(88,101,242,0.15); color: var(--blue); }
.ticket-meta { font-size: 0.78rem; color: var(--text-muted); }
.ticket-messages { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.ticket-msg { padding: 8px 12px; background: var(--bg-primary); border-radius: 6px; font-size: 0.82rem; }
.ticket-msg .msg-from { font-weight: 600; color: var(--accent-light); font-size: 0.73rem; text-transform: uppercase; }
.ticket-msg .msg-content { color: var(--text-secondary); margin-top: 2px; }
.ticket-actions { display: flex; gap: 6px; margin-top: 8px; }
.ticket-reply-input { flex: 1; padding: 8px 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-family: var(--font); font-size: 0.82rem; outline: none; }

.cmd-card { display: flex; align-items: center; gap: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 18px; margin-bottom: 6px; }
.cmd-trigger { font-weight: 700; font-family: 'Courier New', monospace; color: var(--accent-light); min-width: 100px; }
.cmd-response { flex: 1; font-size: 0.85rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-delete { background: none; border: 1px solid var(--red); color: var(--red); padding: 4px 10px; border-radius: var(--radius-sm); font-size: 0.7rem; cursor: pointer; transition: all var(--transition); }
.cmd-delete:hover { background: var(--red); color: #fff; }

.automod-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 8px; }
.automod-card:hover { border-color: var(--border-hover); }
.automod-header { display: flex; justify-content: space-between; align-items: center; }
.automod-name { font-weight: 600; font-size: 0.92rem; }
.automod-type { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }

.toggle-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.88rem; color: var(--text-primary); margin-bottom: 10px; padding: 6px 0; }
.toggle-label input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 40px; height: 22px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 12px; position: relative; cursor: pointer; transition: all var(--transition); flex-shrink: 0; }
.toggle-label input[type="checkbox"]::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-muted); transition: all var(--transition); }
.toggle-label input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.toggle-label input[type="checkbox"]:checked::after { left: 20px; background: #fff; }
.form-warning-text { color: var(--orange); font-size: 0.82rem; margin-bottom: 10px; }
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-row .input-field { flex: 1; min-width: 120px; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 30px rgba(0,0,0,0.5); }
  .mobile-header { display: flex; }
  .main-content { margin-left: 0; padding: 72px 14px 32px; }
  .stats-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .members-grid { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .search-box input { width: 130px; }
  .activity-feed { width: 100%; }
  .form-tabs { flex-wrap: wrap; }
}
