:root {
  --bg: #0f0f12;
  --bg-card: #16161c;
  --bg-card-hover: #1c1c24;
  --bg-elevated: #1a1a22;
  --bg-glass: rgba(22, 22, 28, 0.7);
  --border: #2a2a34;
  --text: #e8e8ed;
  --text-muted: #8b8b9a;
  --accent: #7c6bff;
  --accent-dim: #5c4ddb;
  --accent-glow: rgba(124, 107, 255, 0.25);
  --accent-light: rgba(124, 107, 255, 0.08);
  --online: #43b581;
  --idle: #faa61a;
  --dnd: #f04747;
  --offline: #747f8d;
  --radius: 12px;
  --font: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --shadow-card: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-elevated: 0 8px 32px rgba(0,0,0,0.45);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
::selection { background: var(--accent); color: #fff; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── LOGIN ─── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.login-screen::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: loginPulse 6s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes loginPulse {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  100% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.8; }
}
.login-screen.hidden { display: none; }

.login-box {
  width: 100%;
  max-width: 380px;
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(124,107,255,0.15);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-elevated);
  position: relative;
  z-index: 1;
}
.login-logo {
  text-align: center;
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  text-shadow: 0 0 32px var(--accent-glow), 0 0 64px var(--accent-glow);
}
.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.25rem;
}
.login-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 2rem;
}
.login-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.login-form input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  margin-bottom: 1.15rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 15, 18, 0.6);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  transition: all var(--transition);
}
.login-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.login-error {
  color: var(--dnd);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}
.login-error.hidden { display: none; }
.login-submit {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
}
.login-submit:hover {
  background: var(--accent-dim);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

/* Discord login button */
.login-discord {
  width: 100%;
  padding: 0.8rem 1rem;
  margin: 0 0 1rem 0;
  border: none;
  border-radius: 10px;
  background: #5865F2;
  color: #fff;
  font-weight: 600;
  font: inherit;
  font-size: 0.98rem;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.login-discord:hover {
  background: #4752C4;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(88,101,242,0.45);
}
.login-discord.hidden { display: none !important; }
.login-separator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0.75rem 0 1rem 0;
  color: var(--text-muted, #8a8f9a);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.login-separator::before,
.login-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border, rgba(255,255,255,0.1));
}
.login-separator.hidden { display: none !important; }

/* Add to Server — topbar */
.topbar-invite {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #5865F2;
  color: #fff !important;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  margin-right: 8px;
}
.topbar-invite:hover {
  background: #4752C4;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(88,101,242,0.4);
}
.topbar-invite.hidden { display: none !important; }
.topbar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 6px;
}
.topbar-user-avatar.hidden { display: none !important; }

/* Welcome screen — Add to Server */
.welcome-invite-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 1.5rem;
  padding: 12px 24px;
  background: #5865F2;
  color: #fff !important;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: 0 4px 14px rgba(88,101,242,0.3);
}
.welcome-invite-btn:hover {
  background: #4752C4;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(88,101,242,0.5);
}
.welcome-invite-btn.hidden { display: none !important; }

/* OAuth config section */
.oauth-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}
.oauth-row label {
  font-size: 0.8rem;
  color: var(--text-muted, #8a8f9a);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.owner-only.hidden { display: none !important; }
.login-submit:active { transform: translateY(0); }
.login-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ─── APP LAYOUT ─── */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}
.app.hidden { display: none; }

/* ─── SIDEBAR ─── */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand-icon {
  font-size: 1.5rem;
  color: var(--accent);
  text-shadow: 0 0 16px var(--accent-glow);
}
.sidebar-brand-text {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.sidebar-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 1rem 1.5rem 0.5rem;
}
.sidebar-servers {
  flex: 1;
  padding: 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.server-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  width: 100%;
  border-left: 3px solid transparent;
}
.server-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}
.server-btn.active {
  background: var(--accent-light);
  color: var(--text);
  border-left-color: var(--accent);
}
.server-btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}
.server-btn-initial {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent);
  flex-shrink: 0;
}
.server-btn-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.server-btn-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.sidebar-footer {
  margin-top: auto;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* ─── STATUS PILL ─── */
.status-pill {
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  text-align: center;
}
.status-pill.ready {
  background: rgba(67, 181, 129, 0.12);
  border-color: var(--online);
  color: var(--online);
}
.status-pill.loading { color: var(--text-muted); }

/* ─── APP CONTENT ─── */
.app-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ─── TOPBAR ─── */
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 15, 18, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}
.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}
.topbar-crumb-root { color: var(--text-muted); }
.topbar-crumb-sep { color: var(--border); }
.topbar-crumb-guild { font-weight: 600; color: var(--text); }
.topbar-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.topbar-user-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
}
.topbar-user-role {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid var(--accent);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}
.topbar-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.topbar-logout:hover {
  background: rgba(240, 71, 71, 0.12);
  border-color: var(--dnd);
  color: var(--dnd);
}
.topbar-logout svg { flex-shrink: 0; }

/* ─── MAIN ─── */
.main {
  flex: 1;
  padding: 0;
}

/* ─── WELCOME ─── */
.welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  text-align: center;
  padding: 2rem;
}
.welcome.hidden { display: none !important; }
.welcome-icon {
  font-size: 3.5rem;
  color: var(--accent);
  margin-bottom: 1rem;
  text-shadow: 0 0 40px var(--accent-glow);
  opacity: 0.6;
}
.welcome h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.welcome p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ─── DASHBOARD ─── */
.dashboard.hidden { display: none !important; }
.dashboard {
  display: block;
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── GUILD HERO ─── */
.guild-hero {
  position: relative;
  margin-bottom: 1.5rem;
}
.hero-banner {
  height: 200px;
  background: linear-gradient(135deg, var(--accent-dim) 0%, #1a1028 40%, var(--bg-card) 100%);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
.hero-banner.has-banner {
  background-size: cover;
  background-position: center;
}
.hero-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, transparent 40%, var(--bg) 100%);
}
.hero-content {
  position: relative;
  margin-top: -56px;
  padding: 0 2rem 1.5rem;
  z-index: 2;
}
.hero-profile {
  display: flex;
  align-items: flex-end;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.hero-avatar {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  border: 4px solid var(--bg);
  box-shadow: var(--shadow-card);
  object-fit: cover;
  background: var(--bg-card);
}
.hero-info {
  flex: 1;
  min-width: 0;
  padding-bottom: 0.25rem;
}
.hero-name {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.15rem;
}
.hero-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent-light);
  border: 1px solid rgba(124,107,255,0.12);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
}
.hero-badge:empty { display: none; }

.hero-stats {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.hero-stat {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1.15rem;
  text-align: center;
  min-width: 90px;
  transition: all var(--transition);
}
.hero-stat:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.hero-stat-online {
  border-color: rgba(67, 181, 129, 0.3);
}
.hero-stat-online:hover {
  border-color: var(--online);
}
.hero-stat-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1.2;
}
.hero-stat-online .hero-stat-value { color: var(--online); }
.hero-stat-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ─── TABS (legacy, hidden — now rendered in nav-sidebar) ─── */
.tabs { display: none; }

/* ─── NAV SIDEBAR (grouped vertical tabs) ─── */
.nav-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  transition: width var(--transition), margin var(--transition);
}
.nav-sidebar-inner {
  padding: 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.nav-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem 0.35rem;
}
.nav-item {
  font-family: var(--font);
  font-size: 0.86rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}
.nav-item svg { opacity: 0.65; flex-shrink: 0; transition: opacity var(--transition); }
.nav-item:hover {
  color: var(--text);
  background: var(--bg-card-hover);
}
.nav-item:hover svg { opacity: 0.9; }
.nav-item.active {
  color: var(--text);
  background: var(--accent-light);
  border-left-color: var(--accent);
}
.nav-item.active svg { opacity: 1; stroke: var(--accent); }

/* ─── SERVER SIDEBAR COLLAPSED STATE ─── */
.sidebar.collapsed {
  width: 0;
  min-width: 0;
  border-right-width: 0;
  overflow: hidden;
}

/* ─── OWNER BOT PANEL (global settings — owner only, below server list) ─── */
.owner-bot-panel {
  border-top: 1px solid var(--border);
  margin-top: 0.75rem;
  padding: 0.5rem 0.4rem 0.25rem;
}
.owner-bot-panel.hidden { display: none; }
.owner-bot-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.owner-bot-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--bg-card-hover);
}
.owner-bot-toggle .chev {
  margin-left: auto;
  transition: transform var(--transition);
}
.owner-bot-toggle[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}
.owner-bot-body {
  padding: 0.65rem 0.3rem 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.owner-bot-avatar-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem;
  background: var(--bg-card-hover);
  border-radius: 8px;
  margin-bottom: 0.35rem;
}
.owner-bot-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  flex-shrink: 0;
}
.owner-bot-ident { min-width: 0; flex: 1; }
.owner-bot-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.owner-bot-id {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.owner-bot-label {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.35rem;
}
.owner-bot-row {
  display: flex;
  gap: 0.4rem;
  align-items: stretch;
}
.owner-bot-input {
  flex: 1;
  padding: 0.4rem 0.55rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.82rem;
  min-width: 0;
  outline: none;
}
.owner-bot-input:focus {
  border-color: var(--accent);
}
.owner-bot-input-block { width: 100%; }
.owner-bot-btn {
  padding: 0.4rem 0.75rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.owner-bot-btn:hover { background: var(--accent-hover, #4752c4); }
.owner-bot-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.owner-bot-btn-block {
  width: 100%;
  margin-top: 0.35rem;
}
.owner-bot-upload {
  padding: 0.6rem;
  border: 1px dashed var(--border);
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.78rem;
  transition: all var(--transition);
}
.owner-bot-upload:hover,
.owner-bot-upload.dragover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--bg-card-hover);
}
.owner-bot-upload.has-file {
  border-style: solid;
  border-color: var(--accent);
  color: var(--text);
}
.owner-bot-status {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  min-height: 1em;
}

/* Owner bot panel — OAuth subsection */
.owner-bot-divider {
  height: 1px;
  background: var(--border);
  margin: 1rem 0 0.9rem;
  opacity: 0.6;
}
.owner-bot-subsection {
  display: block;
}
.owner-bot-section-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
  letter-spacing: 0.02em;
}
.owner-bot-section-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0 0 0.6rem;
}
.owner-bot-section-desc a {
  color: #5865f2;
  text-decoration: none;
}
.owner-bot-section-desc a:hover { text-decoration: underline; }
.owner-bot-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  font-weight: 400;
}
.owner-bot-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.7rem;
}
.owner-bot-btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.owner-bot-btn-ghost:hover {
  background: var(--bg-hover, rgba(255,255,255,0.04));
  color: var(--text);
}
.oauth-log-view {
  margin-top: 0.6rem;
  padding: 0.6rem;
  background: #0d0f14;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.65rem;
  line-height: 1.4;
  color: #a8b3c8;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ─── SIDEBAR DIVIDER TOGGLE (between server sidebar and nav sidebar) ─── */
.sidebar-divider-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  min-width: 18px;
  height: auto;
  align-self: stretch;
  padding: 0;
  margin: 0;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
  z-index: 5;
}
.sidebar-divider-toggle:hover {
  background: var(--bg-card-hover);
  color: var(--accent);
}
.sidebar-divider-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.sidebar-divider-toggle .icon-collapse { display: inline-block; }
.sidebar-divider-toggle .icon-expand { display: none; }
.sidebar-divider-toggle.active .icon-collapse { display: none; }
.sidebar-divider-toggle.active .icon-expand { display: inline-block; }

/* ─── TAB PANELS ─── */
.tab-panels { padding: 0 2rem 2rem; }
.tab-panel { display: none; }
.tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ─── SUB-TABS (inside BOT aktivnosti) ─── */
.sub-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 4px;
  border: 1px solid var(--border);
}
.sub-tab {
  font-family: var(--font);
  font-size: 0.84rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  flex: 1;
  justify-content: center;
}
.sub-tab svg { opacity: 0.5; transition: opacity var(--transition); }
.sub-tab:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}
.sub-tab:hover svg { opacity: 0.8; }
.sub-tab.active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 2px 8px var(--accent-glow);
}
.sub-tab.active svg { opacity: 1; stroke: #fff; }

.sub-tab-panel { display: none; }
.sub-tab-panel.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

/* ─── EDIT BANNER ─── */
.edit-banner {
  background: linear-gradient(135deg, rgba(124, 107, 255, 0.15), rgba(124, 107, 255, 0.05));
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  animation: fadeIn 0.25s ease;
}
.edit-banner span {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}
.edit-banner-cancel {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--transition);
}
.edit-banner-cancel:hover {
  border-color: var(--dnd);
  color: var(--dnd);
}

/* ─── SCHEDULED ITEM EDIT BUTTON ─── */
.msg-btn-edit {
  background: rgba(124, 107, 255, 0.12);
  color: var(--accent);
  border: 1px solid rgba(124, 107, 255, 0.3);
}
.msg-btn-edit:hover {
  background: rgba(124, 107, 255, 0.25);
  border-color: var(--accent);
}

/* Currently editing highlight */
.sched-item-editing {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px var(--accent-glow), var(--shadow-card);
}

/* ─── SCHEDULED BADGES ─── */
.sched-badge-img {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(67, 181, 129, 0.1);
  color: var(--online);
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(67, 181, 129, 0.2);
}
.sched-badge-extra {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(250, 166, 26, 0.1);
  color: var(--idle);
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(250, 166, 26, 0.2);
}

/* ─── EMPTY STATES ─── */
.empty-state {
  position: relative;
  min-height: 380px;
  overflow: hidden;
  border-radius: var(--radius);
}
.empty-state-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.empty-state-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  height: 85px;
}
.skeleton-action {
  height: 100px;
  border-left: 3px solid var(--accent-dim);
}
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--border) 25%, var(--bg-card-hover) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
}
.skeleton-line.wide { width: 65%; margin-bottom: 0.75rem; }
.skeleton-line.narrow { width: 40%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.empty-state-chart {
  margin-bottom: 1rem;
}
.skeleton-chart {
  height: 180px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--border) 25%, var(--bg-card-hover) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
  opacity: 0.5;
}
.empty-state-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(15,15,18,0.9) 0%, rgba(15,15,18,0.65) 100%);
  z-index: 5;
}
.empty-state-icon {
  color: var(--accent);
  opacity: 0.7;
  margin-bottom: 1rem;
}
.empty-state-overlay h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
}
.empty-state-overlay p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ─── SUMMARY CARDS ─── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 900px) { .summary-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .summary-grid { grid-template-columns: 1fr; } }

.summary-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  transition: all var(--transition);
}
.summary-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.summary-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.summary-icon-msg { background: rgba(124,107,255,0.12); color: var(--accent); }
.summary-icon-msg7 { background: rgba(92,77,219,0.12); color: var(--accent-dim); }
.summary-icon-voice { background: rgba(67,181,129,0.12); color: var(--online); }
.summary-icon-new { background: rgba(250,166,26,0.12); color: var(--idle); }
.summary-icon-active { background: rgba(240,71,71,0.12); color: var(--dnd); }
.summary-icon-uptime { background: rgba(116,127,141,0.12); color: var(--offline); }
.summary-card-body { min-width: 0; }
.summary-card-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1.2;
}
.summary-card-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* ─── ANALYTICS SECTIONS ─── */
.analytics-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.analytics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 700px) { .analytics-row { grid-template-columns: 1fr; } }
.analytics-section-half { margin-bottom: 0; }

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}
.section-title svg { opacity: 0.6; }

/* ─── STAT TILES ─── */
.stat-row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  gap: 0.6rem;
}
.stat-row-compact {
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}
.stat-tile {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  text-align: center;
  transition: all var(--transition);
}
.stat-tile:hover {
  border-color: var(--border);
  background: var(--bg-card-hover);
}
.stat-tile-accent { border-color: rgba(124,107,255,0.2); }
.stat-tile-accent:hover { border-color: var(--accent-dim); }
.stat-tile-accent .stat-tile-value { color: var(--accent); }
.stat-tile-online .stat-tile-value { color: var(--online); }
.stat-tile-idle .stat-tile-value { color: var(--idle); }
.stat-tile-dnd .stat-tile-value { color: var(--dnd); }

.stat-tile-value {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1.2;
}
.stat-tile-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ─── PRESENCE BAR ─── */
.presence-bar-wrap { margin-top: 1rem; }
.presence-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg);
}
.presence-bar span {
  min-width: 0;
  transition: flex 0.4s ease;
}
.presence-bar .seg-online { background: var(--online); }
.presence-bar .seg-idle { background: var(--idle); }
.presence-bar .seg-dnd { background: var(--dnd); }
.presence-bar .seg-offline { background: var(--offline); }

.presence-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.legend-item { display: flex; align-items: center; gap: 0.3rem; }
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.legend-dot.online { background: var(--online); }
.legend-dot.idle { background: var(--idle); }
.legend-dot.dnd { background: var(--dnd); }
.legend-dot.offline { background: var(--offline); }

.boost-progress-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}
.boost-progress-text:empty { display: none; }

/* ─── CHART HEADER ─── */
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0;
}
.chart-header .section-title { margin-bottom: 0; }
.chart-toggle {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}
.chart-toggle-btn {
  padding: 0.3rem 0.65rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.chart-toggle-btn:hover { color: var(--text); }
.chart-toggle-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ─── HOUR CHART ─── */
.hour-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
  padding-top: 0.5rem;
}
.hour-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 4px;
}
.hour-bar {
  width: 100%;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
  transition: height 0.4s ease, background 0.2s;
  position: relative;
}
.hour-bar:hover {
  background: var(--accent-dim);
}
.hour-bar-wrap:hover .hour-bar-tooltip {
  opacity: 1;
  transform: translateY(-4px);
}
.hour-bar-tooltip {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 0.15s ease;
  z-index: 10;
}
.hour-label {
  font-size: 0.55rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ─── LEADERBOARD ─── */
.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 420px;
  overflow-y: auto;
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid transparent;
  transition: all var(--transition);
}
.lb-row:hover {
  border-color: var(--border);
  background: var(--bg-card-hover);
}
.lb-rank {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--bg-card);
  color: var(--text-muted);
  flex-shrink: 0;
}
.lb-rank-1 { background: rgba(255,215,0,0.15); color: #ffd700; }
.lb-rank-2 { background: rgba(192,192,192,0.12); color: #c0c0c0; }
.lb-rank-3 { background: rgba(205,127,50,0.12); color: #cd7f32; }
.lb-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-card);
}
.lb-channel-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.8rem;
}
.lb-info {
  flex: 1;
  min-width: 0;
}
.lb-name {
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-bar-bg {
  height: 4px;
  background: var(--bg-card);
  border-radius: 2px;
  margin-top: 3px;
  overflow: hidden;
}
.lb-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.4s ease;
}
.lb-bar-fill-voice { background: var(--online); }
.lb-value {
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}
.lb-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ─── BOT AKTIVNOSTI ─── */
.bot-section-header {
  margin-bottom: 1.25rem;
}
.bot-section-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.cmd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}
@media (max-width: 600px) { .cmd-grid { grid-template-columns: 1fr; } }

.cmd-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.cmd-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.cmd-card-featured {
  border-color: rgba(124,107,255,0.3);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(124,107,255,0.04) 100%);
}
.cmd-new-badge {
  position: absolute;
  top: 12px;
  right: -28px;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 32px;
  transform: rotate(45deg);
}

.cmd-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.cmd-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cmd-icon-blue { background: rgba(88,101,242,0.12); color: #5865f2; }
.cmd-icon-green { background: rgba(67,181,129,0.12); color: var(--online); }
.cmd-icon-purple { background: rgba(124,107,255,0.12); color: var(--accent); }

.cmd-name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  display: block;
  line-height: 1.3;
}
.cmd-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(67,181,129,0.12);
  color: var(--online);
  margin-top: 2px;
}

.cmd-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.cmd-preview {
  margin-bottom: 1rem;
}
.cmd-preview-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.cmd-embed {
  border-radius: 8px;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-left: 4px solid var(--border);
  font-size: 0.78rem;
  line-height: 1.5;
}
.cmd-embed-blue { border-left-color: #5865f2; }
.cmd-embed-green { border-left-color: var(--online); }
.cmd-embed-purple { border-left-color: var(--accent); }
.cmd-embed-title {
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}
.cmd-embed-body {
  color: var(--text-muted);
  font-size: 0.78rem;
}
.cmd-embed-body b { color: var(--text); font-weight: 600; }
.cmd-embed-body code {
  background: var(--bg-card);
  padding: 0 4px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.cmd-embed-footer {
  margin-top: 0.5rem;
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.cmd-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.cmd-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.cmd-meta-item svg { opacity: 0.5; }
.cmd-param-opt {
  font-style: italic;
  opacity: 0.7;
}

/* ─── MESSAGE FORMS ─── */
.msg-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.msg-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
}
.msg-section-title svg { opacity: 0.6; }
.msg-section-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--accent-light);
  color: var(--accent);
  padding: 1px 7px;
  border-radius: 999px;
  font-family: var(--font-mono);
}
.msg-form { display: flex; flex-direction: column; gap: 0.75rem; }
.msg-form-row { display: grid; grid-template-columns: 1fr auto; gap: 0.75rem; align-items: end; }
@media (max-width: 600px) { .msg-form-row { grid-template-columns: 1fr; } }
.msg-field { display: flex; flex-direction: column; gap: 0.3rem; }
.msg-field label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.msg-opt { font-weight: 400; text-transform: none; letter-spacing: 0; opacity: 0.7; }
.msg-field-color { width: 60px; }
.msg-input {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  transition: all var(--transition);
}
.msg-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
select.msg-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8b9a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}
select.msg-input option { background: var(--bg-card); color: var(--text); }
.msg-textarea { resize: vertical; min-height: 70px; }
.msg-color-input {
  width: 42px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  padding: 2px;
}
.msg-color-input::-webkit-color-swatch-wrapper { padding: 0; }
.msg-color-input::-webkit-color-swatch { border-radius: 5px; border: none; }

.msg-preview-box { margin-top: 0.25rem; }
.msg-preview-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.msg-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}
.msg-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.15rem;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.msg-btn-send {
  background: var(--accent);
  color: #fff;
}
.msg-btn-send:hover {
  background: var(--accent-dim);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow);
}
.msg-btn-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.msg-btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.msg-btn-outline:hover {
  background: var(--accent-light);
}
.msg-btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.msg-btn-ghost:hover { color: var(--text); }
.msg-btn-danger {
  background: rgba(240,71,71,0.1);
  color: var(--dnd);
  border: none;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
}
.msg-btn-danger:hover { background: rgba(240,71,71,0.2); }
.msg-btn-toggle {
  background: rgba(67,181,129,0.1);
  color: var(--online);
  border: none;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
}
.msg-btn-toggle.off {
  background: rgba(116,127,141,0.1);
  color: var(--offline);
}
.msg-status {
  font-size: 0.8rem;
  color: var(--online);
  font-weight: 500;
}
.msg-status.error { color: var(--dnd); }

/* ─── CHANNEL PICKER ─── */
.channel-picker {
  position: relative;
}
.channel-picker-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  min-height: 38px;
  cursor: pointer;
  transition: all var(--transition);
  align-items: center;
}
.channel-picker-selected:hover { border-color: var(--accent-dim); }
.channel-picker.open .channel-picker-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.channel-picker-placeholder {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.channel-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--accent-light);
  border: 1px solid rgba(124,107,255,0.2);
  color: var(--accent);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
}
.channel-chip-remove {
  cursor: pointer;
  opacity: 0.6;
  font-size: 0.85rem;
  line-height: 1;
  margin-left: 0.15rem;
}
.channel-chip-remove:hover { opacity: 1; }
.channel-picker-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-elevated);
  z-index: 100;
  max-height: 280px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.channel-picker-dropdown.hidden { display: none; }
.channel-picker-search {
  padding: 0.55rem 0.75rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  outline: none;
}
.channel-picker-list {
  overflow-y: auto;
  padding: 0.35rem;
}
.channel-picker-cat {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.4rem 0.5rem 0.2rem;
}
.channel-picker-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: all var(--transition);
}
.channel-picker-item:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}
.channel-picker-item.selected {
  background: var(--accent-light);
  color: var(--accent);
}
.channel-picker-item .cp-check {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  transition: all var(--transition);
}
.channel-picker-item.selected .cp-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ─── SEND MODE TOGGLE ─── */
.send-mode-toggle {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}
.send-mode-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.send-mode-btn:hover {
  color: var(--text);
  background: var(--bg-card-hover);
}
.send-mode-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}
.send-mode-btn svg { opacity: 0.7; }
.send-mode-btn.active svg { opacity: 1; }

/* ─── SCHEDULE OPTIONS ─── */
.schedule-options {
  background: var(--bg);
  border: 1px solid rgba(124,107,255,0.2);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: fadeIn 0.3s ease;
}
.schedule-options.hidden { display: none; }
.schedule-options-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── SCHEDULED LIST ─── */
.sched-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.sched-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all var(--transition);
}
.sched-item:hover { border-color: var(--accent-dim); }
.sched-item.disabled { opacity: 0.5; }
.sched-color-dot {
  width: 6px;
  height: 32px;
  border-radius: 3px;
  flex-shrink: 0;
}
.sched-info { flex: 1; min-width: 0; }
.sched-title {
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sched-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
  margin-top: 2px;
}
.sched-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}
.sched-add-toggle { margin-bottom: 0.75rem; }
.sched-form.hidden { display: none; }
.sched-form {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ─── DAY PICKER ─── */
.day-picker {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.day-chip {
  cursor: pointer;
}
.day-chip input { display: none; }
.day-chip span {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition);
}
.day-chip input:checked + span {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.day-chip:hover span {
  border-color: var(--accent-dim);
}

/* ─── EMBED EDITOR LAYOUT ─── */
.embed-editor-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 1100px) { .embed-editor-wrap { grid-template-columns: 1fr; } }
.embed-editor {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.embed-preview-pane {
  position: sticky;
  top: 70px;
  align-self: start;
}
.embed-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.embed-section summary {
  padding: 0.55rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  background: var(--bg);
  border: none;
  user-select: none;
}
.embed-section summary:hover { color: var(--text); }
.embed-section[open] summary { border-bottom: 1px solid var(--border); }
.embed-section-body { padding: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.embed-checkbox {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: 0.25rem;
}
.embed-checkbox input { accent-color: var(--accent); }

/* ─── FILE UPLOAD ZONE ─── */
.file-upload-zone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg);
}
.file-upload-zone:hover, .file-upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.file-upload-zone-sm { padding: 0.85rem; }
.file-upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.file-upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  pointer-events: none;
}
.file-upload-content svg { opacity: 0.4; }
.file-upload-zone.has-file { border-color: var(--online); border-style: solid; }
.file-upload-zone.has-file .file-upload-content svg { stroke: var(--online); opacity: 0.8; }
.file-upload-zone.has-file .file-upload-content span { color: var(--online); }

/* File upload wrapper with remove button */
.file-upload-wrapper {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
}
.file-upload-wrapper .file-upload-zone {
  flex: 1;
  min-width: 0;
}
.file-remove-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-width: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.file-remove-btn:hover {
  background: rgba(240, 71, 71, 0.12);
  border-color: var(--dnd);
  color: var(--dnd);
}
.file-remove-btn.hidden { display: none; }

/* Clear editor button */
.msg-btn-clear {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.msg-btn-clear:hover {
  background: rgba(240, 71, 71, 0.1);
  border-color: var(--dnd);
  color: var(--dnd);
}

/* ─── EMBED FIELDS EDITOR ─── */
.embed-fields-list { display: flex; flex-direction: column; gap: 0.5rem; }
.embed-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 0.4rem;
  align-items: end;
}
.embed-field-row input { font-size: 0.82rem; padding: 0.4rem 0.6rem; }
.field-inline-check {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  padding-bottom: 0.3rem;
}
.field-inline-check input { accent-color: var(--accent); }
.field-remove-btn {
  background: none;
  border: none;
  color: var(--dnd);
  cursor: pointer;
  padding: 0.3rem;
  opacity: 0.5;
  transition: opacity var(--transition);
}
.field-remove-btn:hover { opacity: 1; }

/* ─── DISCORD EMBED PREVIEW ─── */
.discord-embed-preview {
  background: #2f3136;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-width: 520px;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.88rem;
  color: #dcddde;
  position: relative;
}
.dep-color-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
  border-radius: 4px 0 0 4px;
}
.dep-body {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 1rem 0.5rem 1.25rem;
}
.dep-content { flex: 1; min-width: 0; }
.dep-author {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.dep-author:empty { display: none; }
.dep-author img { width: 20px; height: 20px; border-radius: 50%; }
.dep-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 0.25rem;
}
.dep-title:empty { display: none; }
.dep-title a { color: #00aff4; text-decoration: none; }
.dep-title a:hover { text-decoration: underline; }
.dep-desc {
  font-size: 0.85rem;
  line-height: 1.4;
  color: #dcddde;
  margin-bottom: 0.5rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.dep-desc:empty { display: none; }
.dep-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.5rem;
}
.dep-fields:empty { display: none; }
.dep-field-block { min-width: 0; }
.dep-field-block.full { grid-column: 1 / -1; }
.dep-field-name { font-size: 0.78rem; font-weight: 600; color: #fff; }
.dep-field-value { font-size: 0.78rem; color: #dcddde; }
.dep-image { margin-top: 0.25rem; }
.dep-image:empty { display: none; }
.dep-image img { max-width: 100%; border-radius: 4px; max-height: 300px; object-fit: cover; }
.dep-thumb { flex-shrink: 0; }
.dep-thumb:empty { display: none; }
.dep-thumb img { width: 80px; height: 80px; border-radius: 4px; object-fit: cover; }
.dep-footer {
  padding: 0.5rem 1rem 0.5rem 1.25rem;
  font-size: 0.72rem;
  color: #72767d;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.dep-footer:empty { display: none; }
.dep-footer img { width: 16px; height: 16px; border-radius: 50%; }
.dep-footer-sep { margin: 0 0.3rem; }

/* ─── ERROR ─── */
.error {
  padding: 1rem;
  background: rgba(240, 71, 71, 0.1);
  border: 1px solid var(--dnd);
  border-radius: var(--radius);
  color: #faa;
  margin-top: 1rem;
}
.error.hidden { display: none !important; }

/* ─── RESPONSIVE ─── */
@media (max-width: 1100px) {
  .nav-sidebar { width: 180px; }
  .nav-item { font-size: 0.82rem; padding: 0.5rem 0.6rem; }
  .nav-group-title { font-size: 0.65rem; }
}
@media (max-width: 900px) {
  .sidebar { width: 72px; }
  .sidebar-brand-text,
  .sidebar-label,
  .server-btn-name,
  .server-btn-count { display: none; }
  .sidebar-brand { justify-content: center; padding: 1.25rem 0.5rem; }
  .server-btn { justify-content: center; padding: 0.6rem; border-left: none; border-bottom: 3px solid transparent; }
  .server-btn.active { border-left-color: transparent; border-bottom-color: var(--accent); }
  .sidebar-servers { padding: 0 0.5rem; align-items: center; }
  .sidebar-footer { padding: 0.75rem 0.5rem; }
  .status-pill { font-size: 0; padding: 0.5rem; }
  .status-pill::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
  .status-pill.ready::before { background: var(--online); }
  .topbar { padding: 0 1.25rem; }
  .hero-content { padding: 0 1.25rem 1rem; }
  .tabs { margin: 0 1.25rem 1rem; }
  .tab-panels { padding: 0 1.25rem 1.5rem; }
  /* Compact nav-sidebar: icon-only with tooltip via title */
  .nav-sidebar { width: 56px; }
  .nav-sidebar-inner { padding: 0.5rem 0.25rem; }
  .nav-item { justify-content: center; padding: 0.6rem; border-left: none; }
  .nav-item span { display: none; }
  .nav-item.active { border-left: none; background: var(--accent-light); }
  .nav-group-title { display: none; }
  .nav-group { gap: 0.25rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
  .nav-group:first-child { border-top: none; padding-top: 0; }
}
@media (max-width: 600px) {
  .hero-banner { height: 140px; }
  .hero-profile { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .hero-avatar { width: 72px; height: 72px; border-radius: 18px; }
  .hero-stats { gap: 0.5rem; }
  .hero-stat { min-width: 70px; padding: 0.6rem 0.75rem; }
  .hero-stat-value { font-size: 1.1rem; }
  .empty-state-grid { grid-template-columns: repeat(2, 1fr); }
  .empty-state-list { grid-template-columns: 1fr; }
  .tab { padding: 0.6rem 1rem; font-size: 0.82rem; }
}

/* ═══════════════════════════════════════════════
   XP SYSTEM
   ═══════════════════════════════════════════════ */

/* ─── XP Leaderboard ─── */
.xp-leaderboard-wrap { margin-top: 0.5rem; }
.xp-lb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.xp-lb-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.xp-lb-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all var(--transition);
}
.xp-lb-item:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.xp-lb-item.top-1 { border-color: #ffd700; background: rgba(255, 215, 0, 0.06); }
.xp-lb-item.top-2 { border-color: #c0c0c0; background: rgba(192, 192, 192, 0.06); }
.xp-lb-item.top-3 { border-color: #cd7f32; background: rgba(205, 127, 50, 0.06); }

.xp-lb-rank {
  font-size: 1.1rem;
  font-weight: 700;
  min-width: 2rem;
  text-align: center;
  color: var(--text-muted);
}
.top-1 .xp-lb-rank { color: #ffd700; }
.top-2 .xp-lb-rank { color: #c0c0c0; }
.top-3 .xp-lb-rank { color: #cd7f32; }

.xp-lb-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.xp-lb-avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}
.xp-lb-info {
  flex: 1;
  min-width: 0;
}
.xp-lb-name {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xp-lb-stats {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.xp-lb-level-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 50px;
}
.xp-lb-level-num {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.xp-lb-level-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.xp-lb-xp-wrap {
  min-width: 130px;
  text-align: right;
}
.xp-lb-xp-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.xp-lb-xp-text span { color: var(--accent); font-weight: 600; }
.xp-lb-progress {
  width: 100%;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}
.xp-lb-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-dim));
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Pager */
.xp-lb-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}
.xp-lb-pager button {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all var(--transition);
}
.xp-lb-pager button:hover { border-color: var(--accent); background: var(--accent-light); }
.xp-lb-pager button:disabled { opacity: 0.3; cursor: not-allowed; }
.xp-lb-pager span { font-size: 0.8rem; color: var(--text-muted); }

/* ─── XP Settings ─── */
.xp-settings-wrap { margin-top: 0.5rem; }
.xp-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
.xp-setting-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.15rem;
}
.xp-setting-card label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 0.4rem;
}
.xp-setting-card .msg-input {
  width: 100%;
}
.xp-setting-wide {
  grid-column: 1 / -1;
}
.xp-toggle-label {
  display: flex !important;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  margin-bottom: 0 !important;
}
.xp-toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}
.xp-setting-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0.75rem;
}
.xp-settings-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* Level roles list */
.xp-level-roles {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.xp-lr-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.xp-lr-row input[type="number"] {
  width: 70px;
}
.xp-lr-row select {
  flex: 1;
}
.xp-lr-remove {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.xp-lr-remove:hover { background: rgba(240, 71, 71, 0.12); border-color: var(--dnd); color: var(--dnd); }

/* ─── XP EXCLUDED ROLES ─── */
.xp-excluded-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.xp-excluded-role-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.8rem;
}
.xp-excluded-role-item:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.xp-excluded-role-item:has(input:checked) {
  border-color: var(--dnd);
  background: rgba(240, 71, 71, 0.1);
}
.xp-excluded-role-item input[type="checkbox"] {
  accent-color: var(--dnd);
  width: 14px;
  height: 14px;
  cursor: pointer;
}
.xp-excluded-role-name {
  color: var(--text);
  white-space: nowrap;
}

/* ─── XP PUBLISH LEADERBOARD ─── */
.xp-publish-section {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.xp-publish-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 600px) {
  .xp-publish-grid { grid-template-columns: 1fr; }
}

/* Period toggle */
.xp-period-toggle {
  display: flex;
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
}
.xp-period-btn {
  flex: 1;
  padding: 0.5rem 0.35rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  white-space: nowrap;
}
.xp-period-btn:not(:last-child) {
  border-right: 1px solid var(--border);
}
.xp-period-btn:hover {
  background: var(--accent-light);
  color: var(--text);
}
.xp-period-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Top 10 preview */
.xp-top-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: 1rem;
  max-height: 360px;
  overflow-y: auto;
}
.xp-top-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  transition: background var(--transition);
}
.xp-top-item:hover { background: rgba(124, 107, 255, 0.06); }
.xp-top-item.top-1 { background: rgba(255, 215, 0, 0.08); }
.xp-top-item.top-2 { background: rgba(192, 192, 192, 0.08); }
.xp-top-item.top-3 { background: rgba(205, 127, 50, 0.08); }
.xp-top-medal {
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 28px;
  text-align: center;
  color: var(--text-muted);
}
.xp-top-item.top-1 .xp-top-medal { color: #ffd700; font-size: 1.1rem; }
.xp-top-item.top-2 .xp-top-medal { color: #c0c0c0; font-size: 1.05rem; }
.xp-top-item.top-3 .xp-top-medal { color: #cd7f32; font-size: 1rem; }
.xp-top-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.xp-top-avatar-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.7rem;
  flex-shrink: 0;
}
.xp-top-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.xp-top-level {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  white-space: nowrap;
}
.xp-top-xp {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 80px;
  text-align: right;
}
.xp-publish-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Auto-publish */
.xp-auto-publish {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.xp-auto-publish-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.25rem 0;
}
.xp-auto-publish-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.xp-publish-slot {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.xp-publish-slot-header {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
@media (max-width: 600px) {
  .xp-auto-publish-grid { grid-template-columns: 1fr; }
}

/* Edit banner & sched badges from previous work */
.edit-banner {
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--accent);
}
.edit-banner button {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  transition: all var(--transition);
}
.edit-banner button:hover { background: var(--accent); color: #fff; }
.msg-btn-edit {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.72rem;
  transition: all var(--transition);
}
.msg-btn-edit:hover { background: var(--accent); color: #fff; }
.sched-item-editing { border-color: var(--accent) !important; background: var(--accent-light) !important; }
.sched-badge-img {
  display: inline-block;
  background: rgba(124, 107, 255, 0.15);
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  margin-left: 0.3rem;
  vertical-align: middle;
}
.sched-badge-extra {
  display: inline-block;
  background: rgba(67, 181, 129, 0.15);
  color: var(--online);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  margin-left: 0.3rem;
  vertical-align: middle;
}

@media (max-width: 768px) {
  .xp-settings-grid { grid-template-columns: 1fr; }
  .xp-lb-item { gap: 0.5rem; }
  .xp-lb-xp-wrap { min-width: 100px; }
}

/* ── Postavke (Settings) ── */
.settings-section {
  background: var(--card-bg, #1e1f22);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.settings-subtitle {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text, #e0e0e0);
  margin: 0 0 1rem 0;
}

.bot-avatar-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.bot-avatar-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.bot-avatar-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg, #2b2d31);
  border: 3px solid var(--accent, #5865f2);
}

.bot-avatar-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.bot-avatar-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text, #e0e0e0);
}

.bot-avatar-hint {
  font-size: 0.8rem;
  color: var(--muted, #888);
}

.bot-avatar-upload {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.bot-avatar-upload .file-upload-zone {
  flex: 1;
  min-width: 200px;
  max-width: 350px;
}

/* ── Giveaway ── */
.ga-create-btn {
  float: right;
  font-size: 0.85rem;
  margin-top: -4px;
}
.ga-form-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}
.ga-form-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ga-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ga-form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .3px;
}
.ga-form-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.ga-form-row .ga-form-group {
  flex: 1;
  min-width: 140px;
}
.ga-textarea {
  min-height: 70px;
  resize: vertical;
}
.ga-color-input {
  width: 60px;
  height: 38px;
  padding: 2px;
  cursor: pointer;
}

/* Missions */
.ga-missions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.ga-mission-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
}
.ga-mission-item .ga-mission-icon {
  font-size: 1.2rem;
}
.ga-mission-item .ga-mission-text {
  flex: 1;
  color: var(--fg);
}
.ga-mission-item .ga-mission-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all .15s;
}
.ga-mission-item .ga-mission-remove:hover {
  color: #ef4444;
  background: rgba(239,68,68,.1);
}
.ga-add-mission {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.ga-add-mission select,
.ga-add-mission input {
  max-width: 180px;
}
.ga-add-mission-btn {
  white-space: nowrap;
}
.ga-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

/* Giveaway list */
.ga-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}
.ga-empty {
  color: var(--muted);
  text-align: center;
  padding: 32px;
  font-size: 0.95rem;
}
.ga-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  transition: border-color .15s;
}
.ga-card:hover {
  border-color: var(--accent);
}
.ga-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.ga-card-emoji {
  font-size: 1.6rem;
}
.ga-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
  flex: 1;
}
.ga-card-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 3px 10px;
  border-radius: 999px;
}
.ga-badge-active {
  background: rgba(34,197,94,.15);
  color: #22c55e;
}
.ga-badge-ended {
  background: rgba(156,163,175,.15);
  color: #9ca3af;
}
.ga-card-prize {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}
.ga-card-info {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.ga-card-info span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ga-card-missions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.ga-card-mission-tag {
  font-size: 0.78rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 10px;
  color: var(--fg);
}
.ga-card-progress {
  margin-bottom: 12px;
}
.ga-card-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.ga-card-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width .3s;
}
.ga-card-progress-text {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}
.ga-card-winners {
  margin-bottom: 10px;
}
.ga-card-winners-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fbbf24;
  margin-bottom: 4px;
}
.ga-card-winners-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ga-card-winner-tag {
  font-size: 0.82rem;
  background: rgba(251,191,36,.1);
  color: #fbbf24;
  border-radius: 6px;
  padding: 3px 10px;
  font-weight: 600;
}
.ga-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ga-card-actions button {
  font-size: 0.8rem;
  padding: 5px 14px;
}
.ga-btn-end {
  background: #ef4444 !important;
  color: #fff !important;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: opacity .15s;
}
.ga-btn-end:hover { opacity: .85; }
.ga-btn-reroll {
  background: #f59e0b !important;
  color: #fff !important;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: opacity .15s;
}
.ga-btn-reroll:hover { opacity: .85; }
.ga-btn-delete {
  background: none !important;
  border: 1px solid var(--border) !important;
  color: var(--muted) !important;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
}
.ga-btn-delete:hover {
  border-color: #ef4444 !important;
  color: #ef4444 !important;
}
.ga-ended-title { margin-top: 12px; }
.ga-entries-section {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.ga-entries-toggle {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.82rem;
  padding: 0;
  font-weight: 600;
}
.ga-entries-toggle:hover { text-decoration: underline; }
.ga-entries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.ga-entry-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
}
.ga-entry-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}
.ga-entry-name { flex: 1; color: var(--fg); }
.ga-entry-status {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.ga-entry-complete { color: #22c55e; }
.ga-entry-incomplete { color: #f59e0b; }

/* ── Birthday ── */

/* Summary cards */
.bday-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.bday-summary-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.bday-summary-icon {
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 107, 157, 0.1);
  border-radius: 10px;
  flex-shrink: 0;
}
.bday-summary-body {
  display: flex;
  flex-direction: column;
}
.bday-summary-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.2;
}
.bday-summary-label {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Date picker row */
.bday-date-picker {
  display: flex;
  gap: 8px;
}
.bday-date-select {
  flex: 1;
  min-width: 0;
}

/* Toggle labels */
.bday-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--fg);
  padding: 8px 0;
}
.bday-toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent, #5865f2);
  cursor: pointer;
}

/* Birthday list */
.bday-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bday-empty {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 24px;
}

.bday-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-secondary, rgba(0,0,0,.15));
  border-radius: 10px;
  transition: background 0.15s, border-color 0.15s;
  border: 1px solid transparent;
}
.bday-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}
.bday-item-today {
  background: rgba(255, 107, 157, 0.08) !important;
  border-color: rgba(255, 107, 157, 0.25) !important;
}

.bday-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ff6b9d, #7c6bff);
}
.bday-item-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bday-item-initial {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}

.bday-item-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.bday-item-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bday-item-date {
  font-size: 0.78rem;
  color: var(--muted);
}

.bday-item-countdown {
  flex-shrink: 0;
  font-size: 0.8rem;
}
.bday-today {
  color: #ff6b9d;
  font-weight: 700;
  animation: bdayPulse 1.5s ease-in-out infinite;
}
.bday-days {
  color: var(--muted);
  font-weight: 500;
}

@keyframes bdayPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.02); }
}

.bday-item-delete {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.15s;
  opacity: 0;
}
.bday-item:hover .bday-item-delete {
  opacity: 1;
}
.bday-item-delete:hover {
  color: #ed4245;
  background: rgba(237, 66, 69, 0.12);
}

/* Preview */
.bday-preview-wrapper {
  text-align: center;
  margin: 16px 0;
  padding: 24px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid var(--border);
  position: relative;
}
.bday-preview-img {
  max-width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.bday-preview-actions {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.msg-btn-accent {
  background: linear-gradient(135deg, #ff6b9d, #7c6bff);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.15s, transform 0.1s;
}
.msg-btn-accent:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
.msg-btn-secondary {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.msg-btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}

/* Editor toggle button */
.bday-editor-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  margin-top: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.bday-editor-toggle:hover {
  background: var(--bg-card-hover);
  border-color: #ff6b9d;
}
.bday-editor-toggle span { flex: 1; text-align: left; }
.bday-editor-chevron {
  transition: transform 0.3s;
}
.bday-editor-toggle.active .bday-editor-chevron {
  transform: rotate(180deg);
}

/* Editor panel */
.bday-editor-panel {
  margin-top: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  animation: bdayEdSlide 0.3s ease;
}
@keyframes bdayEdSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.bday-ed-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.bday-ed-section:last-of-type {
  border-bottom: none;
  margin-bottom: 8px;
}
.bday-ed-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #ff6b9d;
  margin-bottom: 12px;
}

/* Color field */
.bday-color-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px 4px 4px;
}
.bday-color-field input[type="color"] {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  padding: 0;
  cursor: pointer;
  background: none;
}
.bday-color-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.bday-color-field input[type="color"]::-webkit-color-swatch { border-radius: 4px; border: none; }
.bday-color-hex {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  user-select: all;
}

/* Range slider */
.bday-range {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
}
.bday-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b9d, #7c6bff);
  cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* BG upload zone */
.bday-bg-upload {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}
.bday-bg-upload:hover {
  border-color: #ff6b9d;
  color: #ff6b9d;
  background: rgba(255, 107, 157, 0.04);
}
.bday-ed-subsection {
  margin-top: 12px;
  padding: 12px;
  background: rgba(0,0,0,0.1);
  border-radius: 8px;
}
.bday-ed-sub-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: block;
}
.bday-btn-sm {
  font-size: 0.75rem !important;
  padding: 5px 12px !important;
  margin-top: 6px;
}
.bday-ed-actions {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* Member flow cards (joined/left) */
.member-flow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.member-flow-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.2s;
}
.member-flow-card:hover {
  border-color: var(--accent);
}
.member-flow-joined { border-top: 3px solid var(--online); }
.member-flow-left { border-top: 3px solid var(--dnd); }
.member-flow-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.member-flow-joined .member-flow-title svg { stroke: var(--online); }
.member-flow-left .member-flow-title svg { stroke: var(--dnd); }
.member-flow-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.member-flow-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-elevated);
  border-radius: 8px;
  transition: background 0.15s;
}
.member-flow-item:hover {
  background: var(--bg-card-hover);
}
.member-flow-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.member-flow-info {
  flex: 1;
  min-width: 0;
}
.member-flow-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.member-flow-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.member-flow-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 12px 0;
  font-style: italic;
}

/* ── TEMPLATE HINT ── */
.template-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 6px;
  line-height: 1.6;
  font-family: 'Courier New', monospace;
}

/* ── AUDIT LOG ── */
.audit-section {
  margin-bottom: 20px;
}
.audit-sessions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.audit-session-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.audit-session-user {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.audit-session-stat {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}
.audit-session-stat span:first-child {
  color: var(--text-muted);
}
.audit-session-stat span:last-child {
  color: var(--text);
  font-weight: 600;
}
.audit-filters {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.audit-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.audit-filter-group label {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.audit-filter-select {
  min-width: 120px;
  max-width: 180px;
}
.audit-log-container {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.audit-table thead {
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 2;
}
.audit-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.audit-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.audit-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}
.audit-table tbody tr:last-child td {
  border-bottom: none;
}
.audit-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.audit-badge-login { background: rgba(87, 242, 135, 0.15); color: #57f287; }
.audit-badge-login_failed { background: rgba(237, 66, 69, 0.15); color: #ed4245; }
.audit-badge-create { background: rgba(88, 101, 242, 0.15); color: #5865f2; }
.audit-badge-update { background: rgba(254, 231, 92, 0.15); color: #fee75c; }
.audit-badge-delete { background: rgba(237, 66, 69, 0.15); color: #ed4245; }
.audit-badge-reset { background: rgba(237, 66, 69, 0.15); color: #ed4245; }
.audit-badge-publish { background: rgba(87, 242, 135, 0.15); color: #57f287; }
.audit-badge-sync { background: rgba(88, 101, 242, 0.15); color: #5865f2; }
.audit-badge-send_message { background: rgba(88, 101, 242, 0.15); color: #5865f2; }
.audit-badge-toggle { background: rgba(254, 231, 92, 0.15); color: #fee75c; }
.audit-badge-end { background: rgba(237, 66, 69, 0.15); color: #ed4245; }

.audit-cat {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
}
.audit-ip {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.audit-role-owner { color: #ed4245; font-weight: 700; }
.audit-role-admin { color: #5865f2; font-weight: 600; }
.audit-role-viewer { color: var(--text-muted); }
.audit-empty {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-style: italic;
}

/* ─── PERIOD COMPARISON ─── */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 700px) { .compare-grid { grid-template-columns: 1fr; } }
.compare-card {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 1rem;
}
.compare-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 600;
}
.compare-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.compare-period {
  flex: 1;
  text-align: center;
}
.compare-period-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.compare-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--text);
}
.compare-period-old .compare-value {
  color: var(--text-muted);
  font-size: 1rem;
}
.compare-arrow {
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--mono);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.compare-arrow.trend-up {
  color: var(--online);
  background: rgba(67, 181, 129, 0.12);
}
.compare-arrow.trend-down {
  color: var(--dnd);
  background: rgba(240, 71, 71, 0.12);
}
.compare-arrow.trend-neutral {
  color: var(--text-muted);
  background: rgba(116, 127, 141, 0.12);
}

/* ─── CATEGORY BAR CHARTS ─── */
.cat-chart { display: flex; flex-direction: column; gap: 6px; }
.cat-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.cat-bar-label {
  width: 140px;
  min-width: 100px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.cat-bar-name {
  font-size: 0.8rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-bar-count {
  font-size: 0.65rem;
  color: var(--text-muted);
}
.cat-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 4px;
  overflow: hidden;
}
.cat-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.cat-bar-value {
  font-size: 0.78rem;
  font-family: var(--mono);
  color: var(--text-muted);
  min-width: 55px;
  text-align: right;
}

/* ─── VOICE NOW ─── */
.voice-now-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.voice-now-channel {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 10px 14px;
}
.voice-now-channel-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--online);
  margin-bottom: 8px;
}
.voice-now-count {
  background: rgba(67, 181, 129, 0.15);
  color: var(--online);
  font-size: 0.7rem;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: auto;
  font-family: var(--mono);
}
.voice-now-users {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.voice-now-user {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 4px 10px 4px 4px;
  border-radius: 20px;
}
.voice-now-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}
.voice-now-name {
  font-size: 0.78rem;
  color: var(--text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── ONLINE NOW ─── */
.online-now-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.online-now-user {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  padding: 5px 10px 5px 5px;
  border-radius: 20px;
  transition: background 0.2s;
}
.online-now-user:hover {
  background: var(--bg-card);
}
.online-now-avatar-wrap {
  position: relative;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.online-now-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.online-now-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  background: var(--online);
  border: 2px solid var(--bg-elevated);
  border-radius: 50%;
}
.online-now-name {
  font-size: 0.78rem;
  color: var(--text);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── DELETED MESSAGES ─── */
.deleted-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 12px;
  margin-bottom: 6px;
}

/* ─── SERVER FEATURES ─── */
.features-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.feature-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(124, 107, 255, 0.1);
  color: var(--accent);
  border: 1px solid rgba(124, 107, 255, 0.2);
}
.feature-badge-special {
  background: rgba(67, 181, 129, 0.12);
  color: var(--online);
  border-color: rgba(67, 181, 129, 0.25);
  font-weight: 600;
}

/* ─── REACTION ROLE EMOJI PICKER ─── */
.rr-mapping-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.rr-emoji-wrap {
  position: relative;
  flex-shrink: 0;
}
.rr-emoji-btn {
  width: 48px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}
.rr-emoji-btn:hover {
  border-color: var(--accent);
  background: var(--bg-card);
}
.rr-emoji-btn-selected {
  font-size: 1.3rem;
  border-color: var(--accent);
}
.rr-emoji-picker {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  width: 320px;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  margin-top: 4px;
}
.rr-emoji-picker.hidden { display: none; }
.rr-ep-section { margin-bottom: 8px; }
.rr-ep-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
  padding-left: 2px;
}
.rr-ep-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.rr-ep-item {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: background 0.15s, transform 0.15s;
}
.rr-ep-item:hover {
  background: var(--accent-light);
  transform: scale(1.15);
}
.rr-ep-custom img {
  border-radius: 3px;
}

/* Reaction preview under embed */
.rr-preview-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  padding: 0 4px;
}
.rr-preview-reaction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(88, 101, 242, 0.15);
  border: 1px solid rgba(88, 101, 242, 0.3);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: default;
}
.rr-preview-reaction img {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}
.rr-preview-reaction-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ─── RR MODE PICKER (reaction / buttons / dropdown) ─── */
.rr-mode-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.rr-mode-opt { cursor: pointer; }
.rr-mode-opt input { position: absolute; opacity: 0; pointer-events: none; }
.rr-mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  transition: all 0.15s ease;
  height: 100%;
}
.rr-mode-opt:hover .rr-mode-card { border-color: var(--accent); background: var(--bg-card-hover); }
.rr-mode-opt input:checked + .rr-mode-card {
  border-color: var(--accent);
  background: rgba(88, 101, 242, 0.12);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.rr-mode-icon { font-size: 1.4rem; line-height: 1; }
.rr-mode-title { font-weight: 600; color: var(--text); font-size: 0.9rem; }
.rr-mode-desc { font-size: 0.75rem; color: var(--text-muted); }

/* Per-mapping extras (button style / dropdown description) shown conditionally */
.rr-mapping-extra { display: none; }
.rr-mapping-row[data-mode="buttons"] .rr-mapping-extra-btnstyle,
.rr-mapping-row[data-mode="dropdown"] .rr-mapping-extra-desc { display: inline-flex; }

/* Button-style selector chips inside a mapping row */
.rr-btn-style-select {
  padding: 4px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.78rem;
  cursor: pointer;
}

/* Preview: buttons & dropdown */
.rr-preview-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
  padding: 0 4px;
}
.rr-preview-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 500;
  border: none;
  cursor: default;
}
.rr-preview-button.btn-primary { background: #5865f2; color: #fff; }
.rr-preview-button.btn-secondary { background: #4e5058; color: #fff; }
.rr-preview-button.btn-success { background: #248046; color: #fff; }
.rr-preview-button.btn-danger { background: #da373c; color: #fff; }
.rr-preview-dropdown {
  margin-top: 8px;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rr-preview-dropdown::after {
  content: "▾";
  opacity: 0.6;
}

/* ─── DATE FILTER ─── */
.analytics-date-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
}
.analytics-filter-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.analytics-filter-btns {
  display: flex;
  gap: 4px;
}
.af-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.af-btn:hover {
  background: rgba(124, 107, 255, 0.08);
  color: var(--text);
}
.af-btn.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* ─── MEMBER GROWTH CHART ─── */
.growth-summary {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.growth-stat {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.growth-stat b { color: var(--text); font-family: var(--mono); }
.growth-stat.trend-up b { color: var(--online); }
.growth-stat.trend-down b { color: var(--dnd); }
.growth-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.growth-dot-join { background: var(--online); }
.growth-dot-leave { background: var(--dnd); }
.growth-chart-wrap {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  min-height: 130px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.growth-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 14px;
}
.growth-bars {
  display: flex;
  gap: 1px;
  align-items: flex-end;
  width: 100%;
}
.growth-bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  min-height: 0;
  transition: height 0.3s ease;
}
.growth-bar-join { background: var(--online); }
.growth-bar-leave { background: var(--dnd); opacity: 0.7; }
.growth-date {
  font-size: 0.55rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
}

/* ─── PEAK HOURS ─── */
.peak-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.peak-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.peak-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(124, 107, 255, 0.12);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--mono);
  padding: 3px 10px;
  border-radius: 6px;
}
.peak-badge-count {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.7rem;
}

/* ─── HEATMAP ─── */
.heatmap-container {
  overflow-x: auto;
}
.hm-grid {
  display: grid;
  grid-template-columns: 40px repeat(24, 1fr);
  gap: 2px;
  min-width: 500px;
}
.hm-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  min-height: 18px;
  min-width: 18px;
}
.hm-corner { background: transparent; }
.hm-hour-label {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.6rem;
  background: transparent;
}
.hm-day-label {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  background: transparent;
  text-align: right;
  padding-right: 4px;
}
.hm-data {
  border-radius: 3px;
  cursor: default;
  transition: transform 0.15s;
}
.hm-data:hover {
  transform: scale(1.3);
  z-index: 2;
  box-shadow: 0 0 6px rgba(124, 107, 255, 0.4);
}

@media (max-width: 700px) {
  .bday-summary { grid-template-columns: 1fr; }
  .bday-date-picker { flex-direction: column; }
  .bday-editor-panel { padding: 12px; }
  .member-flow-grid { grid-template-columns: 1fr; }
  .audit-sessions-grid { grid-template-columns: 1fr; }
  .audit-filters { flex-direction: column; align-items: stretch; }
  .cat-bar-label { width: 100px; min-width: 70px; }
  .analytics-date-filter { flex-wrap: wrap; }
  .analytics-filter-btns { flex-wrap: wrap; }
  .hm-grid { min-width: 450px; }
  .curr-settings-grid { grid-template-columns: 1fr !important; }
  .curr-adjust-grid { grid-template-columns: 1fr !important; }
}

/* ─── Currency ─── */
.currency-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 1.35rem;
  vertical-align: -4px;
}
.currency-title-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
}
.curr-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.5rem;
}
.curr-setting-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.15rem;
}
.curr-setting-card label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 0.4rem;
}
.curr-setting-card .msg-input { width: 100%; }
.curr-setting-wide { grid-column: 1 / -1; }

.curr-icon-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.2rem;
}
.curr-icon-preview {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.curr-icon-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.curr-icon-fallback {
  font-size: 1.9rem;
  line-height: 1;
}
.curr-icon-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.curr-lb-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.curr-lb-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.curr-lb-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color var(--transition), background var(--transition);
}
.curr-lb-row:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.curr-lb-rank {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  color: var(--text-muted);
}
.curr-lb-row.top-1 .curr-lb-rank { background: #ffd700; color: #1a1a1a; border-color: #ffd700; }
.curr-lb-row.top-2 .curr-lb-rank { background: #c0c0c0; color: #1a1a1a; border-color: #c0c0c0; }
.curr-lb-row.top-3 .curr-lb-rank { background: #cd7f32; color: #1a1a1a; border-color: #cd7f32; }
.curr-lb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  object-fit: cover;
  flex-shrink: 0;
}
.curr-lb-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.curr-lb-name small {
  display: block;
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.72rem;
  margin-top: 2px;
}
.curr-lb-balance {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
  flex-shrink: 0;
}
.curr-lb-balance img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.curr-lb-actions {
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
}
.curr-lb-actions button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.curr-lb-actions button:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.curr-adjust-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 0.75rem;
  align-items: end;
}
.curr-adjust-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.3rem;
}
.curr-adjust-field .msg-input { width: 100%; }
.curr-adjust-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ─── Shop ─── */
.shop-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.shop-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.shop-list .lb-empty {
  padding: 1rem;
  color: var(--text-muted);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 10px;
}
.shop-msg-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color var(--transition);
}
.shop-msg-row:hover { border-color: var(--accent); }
.shop-msg-info { flex: 1; min-width: 0; }
.shop-msg-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shop-msg-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.shop-msg-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 600;
}
.shop-msg-badge.published { background: rgba(67, 181, 129, 0.15); border-color: var(--online); color: var(--online); }
.shop-msg-badge.unpublished { color: var(--text-muted); }
.shop-msg-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}
.shop-msg-actions button {
  padding: 0.4rem 0.7rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.shop-msg-actions button:hover { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
.shop-msg-actions button.danger:hover { background: rgba(240, 71, 71, 0.12); border-color: var(--dnd); color: var(--dnd); }

.shop-editor {
  margin-top: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
}
.shop-editor.hidden { display: none; }
.shop-editor-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.75rem;
  align-items: start;
}
.shop-ed-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.3rem;
}
.shop-ed-field .msg-input { width: 100%; }
.shop-ed-wide { grid-column: 1 / -1; }
.shop-ed-field input[type="color"] { height: 38px; padding: 2px; cursor: pointer; }

.shop-mode-toggle {
  display: inline-flex;
  gap: 0.3rem;
  background: var(--card);
  padding: 0.25rem;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.shop-mode-btn {
  padding: 0.4rem 0.8rem;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.shop-mode-btn:hover { color: var(--text); }
.shop-mode-btn.active {
  background: var(--accent);
  color: white;
}

.shop-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.shop-item-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
}
.shop-item-grid-type {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0.5rem;
  align-items: end;
  margin-bottom: 0.5rem;
}
.shop-item-grid-type label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.shop-item-grid-type .msg-input { width: 100%; }
.shop-item-source { min-width: 0; }
.shop-item-source.hidden { display: none; }
.shop-item-info {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  line-height: 1.35;
}
.shop-item-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 0.5rem;
  align-items: end;
}
.shop-item-grid label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.shop-item-grid .msg-input { width: 100%; }
.shop-item-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 0.5rem;
  align-items: end;
  margin-top: 0.5rem;
}
.shop-item-remove {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.shop-item-remove:hover { background: rgba(240, 71, 71, 0.12); border-color: var(--dnd); color: var(--dnd); }

@media (max-width: 900px) {
  .shop-item-grid-type { grid-template-columns: 1fr; }
  .shop-item-grid { grid-template-columns: 1fr 1fr; }
  .shop-item-grid-2 { grid-template-columns: 1fr 1fr; }
  .shop-editor-grid { grid-template-columns: 1fr; }
}

/* ── Role Connection ── */
.rc-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rc-list:empty::before {
  content: "Nema pravila. Klikni \"New role connection\" za dodavanje.";
  display: block;
  padding: 20px;
  text-align: center;
  color: var(--text-muted, #999);
  border: 1px dashed var(--border, rgba(255,255,255,0.1));
  border-radius: 10px;
}
.rc-card {
  background: var(--card-bg, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: border-color var(--transition);
}
.rc-card:hover { border-color: var(--accent-muted, rgba(88, 101, 242, 0.35)); }
.rc-card.disabled { opacity: 0.55; }
.rc-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.rc-card-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rc-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #8a8f9a);
  font-weight: 700;
}
.rc-main-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rc-main-select {
  flex: 1;
  min-width: 0;
}
.rc-hint {
  font-size: 0.82rem;
  color: var(--text-muted, #8a8f9a);
  margin-top: 2px;
}
.rc-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rc-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted, #8a8f9a);
  cursor: pointer;
}
.rc-delete-btn {
  background: transparent;
  border: 1px solid var(--border, rgba(240, 71, 71, 0.25));
  color: var(--dnd, #f04747);
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rc-delete-btn:hover {
  background: rgba(240, 71, 71, 0.12);
}
.rc-conditions {
  border-top: 1px dashed var(--border, rgba(255, 255, 255, 0.08));
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rc-cond-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted, #8a8f9a);
  font-weight: 700;
}
.rc-cond-count {
  background: var(--accent-light, rgba(88,101,242,0.15));
  color: var(--accent, #5865f2);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
}
.rc-operator {
  margin-left: auto;
  min-width: 90px;
}
.rc-cond-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rc-cond-row {
  display: grid;
  grid-template-columns: 28px 110px 1fr 36px;
  align-items: center;
  gap: 8px;
}
.rc-cond-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-light, rgba(88,101,242,0.15));
  color: var(--accent, #5865f2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
}
.rc-cond-remove {
  background: transparent;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  color: var(--text-muted, #8a8f9a);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.rc-cond-remove:hover {
  background: rgba(240, 71, 71, 0.12);
  border-color: var(--dnd, #f04747);
  color: var(--dnd, #f04747);
}
.rc-add-cond {
  align-self: flex-start;
  background: transparent;
  border: 1px dashed var(--border, rgba(88,101,242,0.4));
  color: var(--accent, #5865f2);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}
.rc-add-cond:hover {
  background: var(--accent-light, rgba(88,101,242,0.08));
}

@media (max-width: 760px) {
  .rc-cond-row { grid-template-columns: 28px 1fr; grid-template-rows: auto auto; }
  .rc-cond-row .rc-cond-mode { grid-column: 2; }
  .rc-cond-row .rc-cond-role { grid-column: 1 / span 2; }
  .rc-cond-row .rc-cond-remove { grid-column: 2; justify-self: end; }
}
