:root {
  --bg: #0f0f13;
  --bg-secondary: #1a1a24;
  --bg-card: #1e1e2e;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --text: #e0e0e0;
  --text-muted: #888;
  --border: #2a2a3a;
  --success: #57f287;
  --error: #ed4245;
}

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

/* Custom 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: #3a3a4f; }
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
}

/* Sidebar layout */
body.has-sidebar { display: flex; flex-direction: column; }

.layout {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 64px);
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}

.sidebar-guild {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.sidebar-guild-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-guild-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-guild-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 0 0.5rem;
}

.sidebar-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.75rem 0.75rem 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.sidebar-link:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.sidebar-link.active { background: rgba(88,101,242,0.15); color: var(--accent); }
.sidebar-link svg { flex-shrink: 0; opacity: 0.8; }

.page-main {
  flex: 1;
  padding: 1.25rem 1.5rem;
  min-width: 0;
}

.page-heading {
  margin-bottom: 1.25rem;
}

.page-heading h1 { font-size: 1.5rem; font-weight: 700; }
.page-subtitle { color: var(--text-muted); margin-top: 0.15rem; font-size: 0.88rem; }

/* Overview stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
}

/* Placeholder pages */
.placeholder-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  gap: 1rem;
}

.placeholder-icon { font-size: 3rem; }
.placeholder-page h2 { font-size: 1.4rem; }
.placeholder-page p { color: var(--text-muted); max-width: 400px; line-height: 1.6; }

.navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand a {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.btn {
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
  display: inline-block;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-card); color: var(--text); }
.btn-secondary:hover { background: var(--border); }
.btn-outline { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-outline:hover { color: var(--text); border-color: var(--text-muted); }
.btn-large { padding: 0.9rem 2rem; font-size: 1rem; }

.hero {
  text-align: center;
  padding: 6rem 0 4rem;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #eb459e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 4rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.feature-card h3 {
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-muted);
}

h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.subtitle { color: var(--text-muted); margin-bottom: 2rem; }

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

.guild-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  transition: border-color 0.2s, transform 0.2s;
  color: var(--text);
}

.guild-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.guild-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
}

.guild-icon-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 0.5rem;
}

.guild-icon-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
}

.guild-name {
  font-weight: 600;
  text-align: center;
  font-size: 0.9rem;
}

.empty-state {
  grid-column: 1/-1;
  text-align: center;
  color: var(--text-muted);
  padding: 3rem;
}

.page-header {
  margin-bottom: 2rem;
}

.back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-block;
  margin-bottom: 0.75rem;
}

.back-link:hover { color: var(--text); }

.settings-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  max-width: 800px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form-group select,
.channel-select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.7rem 1rem;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s;
  appearance: none;
  cursor: pointer;
}

.form-group select:focus,
.channel-select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  display: block;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Kanal tabel */
.channel-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.channel-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.channel-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.channel-table tr:last-child td { border-bottom: none; }
.channel-table tr:hover td { background: rgba(255,255,255,0.02); }

.channel-name {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.ch-hash { color: var(--text-muted); }

.ch-category {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
  background: var(--bg);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.num-input {
  width: 80px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  color: var(--text);
  font-size: 0.9rem;
}

.num-input:focus { outline: none; border-color: var(--accent); }

.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.85rem; }
.btn-success { background: var(--success) !important; color: #000 !important; }

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 22px;
  transition: background 0.2s;
  cursor: pointer;
}

.slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle input:checked + .slider { background: var(--accent); }
.toggle input:checked + .slider::before { transform: translateX(18px); }

.loading-state {
  color: var(--text-muted);
  padding: 2rem;
  text-align: center;
}

.empty-cell {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem !important;
}

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

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.7rem 1rem;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
}

.save-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-weight: 600;
}

.save-message.success { background: rgba(87, 242, 135, 0.1); color: var(--success); }
.save-message.error { background: rgba(237, 66, 69, 0.1); color: var(--error); }

/* AutoMod */
.automod-master {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.toggle-large {
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-large .slider::before {
  width: 20px;
  height: 20px;
  left: 4px;
  top: 4px;
}

.toggle-large input:checked + .slider::before { transform: translateX(24px); }

.automod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.automod-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}

.automod-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.automod-card-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.automod-card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.form-row-sm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.num-input-wide {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-size: 0.95rem;
}

.num-input-wide:focus { outline: none; border-color: var(--accent); }

.automod-actions-section { margin-top: 1rem; }

.automod-actions-grid {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  cursor: pointer;
}

.checkbox-label input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.error-page {
  text-align: center;
  padding: 6rem 0;
}

.error-code {
  font-size: 6rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 1rem;
}

.error-message {
  color: var(--text-muted);
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

/* ── XP page ────────────────────────────────────────────── */
.leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.search-input {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  color: var(--text);
  font-size: 0.9rem;
  width: 220px;
}
.search-input:focus { outline: none; border-color: var(--accent); }

.leaderboard-sort-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sort-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
}
.sort-btn:hover { border-color: var(--accent); color: var(--text); }
.sort-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.level-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
}

.xp-bar-wrap {
  background: var(--bg-secondary);
  border-radius: 4px;
  height: 6px;
  width: 120px;
  overflow: hidden;
  margin-bottom: 2px;
}
.xp-bar {
  background: var(--accent);
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}
.xp-val { font-size: 0.8rem; color: var(--text-muted); }

.user-cell { display: flex; align-items: center; gap: 0.6rem; }
.user-avatar-sm { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.user-avatar-placeholder {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 0.8rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Modal */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  min-width: 320px;
  width: 90vw;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.modal-box.modal-wide {
  max-width: 1100px;
}
.modal-box h3 { font-size: 1.1rem; }
.modal-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Modal overlay (standard popup style) */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  animation: modal-fadeIn 0.2s ease-out;
}
.modal-overlay > .modal {
  position: relative; inset: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 90vw;
  max-width: 600px;
  display: flex; flex-direction: column;
  animation: modal-slideIn 0.25s ease-out;
  overflow: hidden;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.15rem; font-weight: 700; margin: 0; }
.modal-close {
  background: none; border: none; color: var(--text-muted); font-size: 1.5rem;
  cursor: pointer; line-height: 1; padding: 0;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 1.5rem; max-height: 65vh; overflow-y: auto; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 0.75rem;
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border);
}

@keyframes modal-fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-slideIn { from { opacity: 0; transform: translateY(-20px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ── Analytics page ─────────────────────────────────────── */
.analytics-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1.5rem;
}

.analytics-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.chart-wrap {
  position: relative;
  height: 220px;
  margin-top: 1rem;
}

.top-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
  padding-right: 0.4rem;
}
.top-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}
.top-row:last-child { border-bottom: none; }
.top-rank {
  width: 22px;
  text-align: center;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.top-name { flex: 1; font-size: 0.9rem; }
.top-val { color: var(--text-muted); font-size: 0.85rem; white-space: nowrap; }
.mod-action-badge {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  text-transform: capitalize;
  flex: 1;
}
.empty-state-sm { color: var(--text-muted); font-size: 0.9rem; padding: 0.5rem 0; }

.loading-state {
  color: var(--text-muted);
  padding: 2rem 0;
  text-align: center;
}

/* ── Announcements page ─────────────────────────────────── */
.announce-preview {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.announce-preview-bar {
  width: 4px;
  flex-shrink: 0;
  background: #5865f2;
}
.announce-preview-body {
  padding: 1rem 1.25rem;
  flex: 1;
}
.announce-preview-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.4rem;
  display: none;
}
.announce-preview-content {
  font-size: 0.9rem;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Raid Protection ───────────────────────────────────── */
.raid-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  max-width: 900px;
}
.raid-active {
  background: rgba(237, 66, 69, 0.12);
  border: 1px solid rgba(237, 66, 69, 0.3);
  color: var(--error);
}
.raid-safe {
  background: rgba(87, 242, 135, 0.08);
  border: 1px solid rgba(87, 242, 135, 0.2);
  color: var(--success);
}

/* ── Embed Builder ─────────────────────────────────────── */
.embed-builder-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 2rem;
  align-items: flex-start;
}
@media (max-width: 1100px) {
  .embed-builder-layout { grid-template-columns: 1fr; }
}
.embed-editor { min-width: 0; }
.embed-preview-panel {
  position: sticky;
  top: 80px;
}

/* Discord embed preview */
.embed-preview {
  background: #2f3136;
  border-radius: 4px;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  max-width: 420px;
  flex-wrap: wrap;
}
.embed-preview-bar {
  width: 4px;
  flex-shrink: 0;
  border-radius: 4px 0 0 4px;
}
.embed-preview-content {
  flex: 1;
  display: flex;
  padding: 0.75rem 1rem 0.75rem 0.75rem;
  gap: 1rem;
}
.embed-preview-main { flex: 1; min-width: 0; }

.ebp-author {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.3rem;
}
.ebp-author-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}
.ebp-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 0.3rem;
}
.ebp-desc {
  font-size: 0.875rem;
  color: #dcddde;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 0.5rem;
}

.ebp-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.ebp-field {
  width: 100%;
}
.ebp-field-inline {
  width: calc(33.33% - 0.35rem);
  min-width: 100px;
}
.ebp-field-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.1rem;
}
.ebp-field-value {
  font-size: 0.8rem;
  color: #dcddde;
  white-space: pre-wrap;
  word-break: break-word;
}

.ebp-thumbnail {
  width: 80px;
  height: 80px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

#ebp-image {
  max-width: 100%;
  border-radius: 4px;
  margin-top: 0.5rem;
}

.ebp-footer {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: #72767d;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.ebp-footer-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #c93b3e; }

/* ── Overview Dashboard ────────────────────────────────── */

/* Stat cards grid */
.ov-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.ov-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  transition: transform 0.2s, border-color 0.2s;
  animation: ov-fadeUp 0.5s ease-out both;
}
.ov-stat-card:hover { transform: translateY(-1px); border-color: rgba(88,101,242,0.3); }

.ov-card-accent { border-left: 3px solid var(--accent); }

.ov-stat-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(88,101,242,0.12);
  color: var(--accent);
  flex-shrink: 0;
}
.ov-stat-icon svg { width: 18px; height: 18px; }
.ov-icon-green  { background: rgba(87,242,135,0.12); color: #57f287; }
.ov-icon-purple { background: rgba(167,139,250,0.12); color: #a78bfa; }
.ov-icon-yellow { background: rgba(254,231,92,0.12); color: #fee75c; }
.ov-icon-red    { background: rgba(237,66,69,0.12); color: #ed4245; }
.ov-icon-orange { background: rgba(244,123,103,0.12); color: #f47b67; }
.ov-icon-cyan   { background: rgba(92,207,238,0.12); color: #5ccfee; }
.ov-icon-pink   { background: rgba(235,69,158,0.12); color: #eb459e; }

.ov-stat-body { display: flex; flex-direction: column; min-width: 0; }
.ov-stat-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 600; line-height: 1.2; }
.ov-stat-value { font-size: 1.25rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.ov-stat-trend { font-size: 0.75rem; font-weight: 700; }
.trend-up { color: #57f287; }
.trend-up::before { content: '\25B2 '; font-size: 0.65rem; }
.trend-down { color: #ed4245; }
.trend-down::before { content: '\25BC '; font-size: 0.65rem; }

/* Chart cards */
.ov-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.ov-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  animation: ov-fadeUp 0.6s ease-out both;
}
.ov-chart-wide { grid-column: span 2; }
.ov-charts-3col { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) { .ov-charts-3col { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); } }
@media (max-width: 900px) { .ov-chart-wide { grid-column: span 1; } }
.ov-chart-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.ov-chart-wrap { position: relative; height: 170px; }

/* User rows */
.ov-user-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
  animation: ov-slideIn 0.4s ease-out both;
}
.ov-user-row:last-child { border-bottom: none; }
.ov-rank { width: 22px; text-align: center; font-weight: 700; color: var(--text-muted); font-size: 0.85rem; }
.ov-user-info { flex: 1; min-width: 0; }
.ov-user-name { font-size: 0.9rem; font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 0.25rem; }
.ov-user-bar-wrap { background: var(--bg-secondary); border-radius: 3px; height: 4px; margin-top: 0.2rem; overflow: hidden; }
.ov-user-bar { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.8s ease-out; }

/* Mod stats rows */
.ov-mod-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
  animation: ov-slideIn 0.4s ease-out both;
}
.ov-mod-row:last-child { border-bottom: none; }
.ov-mod-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; font-weight: 500; text-transform: capitalize; min-width: 80px; }
.ov-mod-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ov-mod-bar-wrap { flex: 1; background: var(--bg-secondary); border-radius: 4px; height: 8px; overflow: hidden; }
.ov-mod-bar { height: 100%; border-radius: 4px; transition: width 1s ease-out; }
.ov-mod-val { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); min-width: 30px; text-align: right; }

/* Recent mod action rows */
.ov-recent-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  animation: ov-slideIn 0.3s ease-out both;
}
.ov-recent-row:last-child { border-bottom: none; }
.ov-action-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.ov-recent-user { color: var(--text-muted); font-family: monospace; font-size: 0.8rem; flex-shrink: 0; }
.ov-recent-reason { flex: 1; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-recent-time { color: var(--text-muted); font-size: 0.78rem; flex-shrink: 0; white-space: nowrap; }

/* Live bar */
.ov-live-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.ov-live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #57f287;
  animation: ov-pulse 2s ease-in-out infinite;
}

/* Animations */
@keyframes ov-fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ov-slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes ov-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(87,242,135,0.4); }
  50%      { opacity: 0.7; box-shadow: 0 0 0 6px rgba(87,242,135,0); }
}

/* ── Server Logs Page ────────────────────────────────── */

.sl-controls {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.25rem;
}
.sl-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.sl-select { width: auto; min-width: 160px; }
.sl-meta { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; color: var(--text-muted); }
.sl-live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #57f287;
  animation: ov-pulse 2s ease-in-out infinite;
}

/* Event rows */
.sl-events { display: flex; flex-direction: column; gap: 2px; }
.sl-event-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.85rem; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; font-size: 0.88rem; cursor: default;
  transition: border-color 0.15s; animation: ov-slideIn 0.3s ease-out both;
}
.sl-event-row:hover { border-color: rgba(88,101,242,0.3); }

.sl-event-badge {
  font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.6rem;
  border-radius: 5px; white-space: nowrap; flex-shrink: 0;
  letter-spacing: 0.02em;
}

.sl-user-badge { display: inline-flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }
.sl-user-av { width: 22px; height: 22px; border-radius: 50%; }
.sl-user-av-ph {
  width: 22px; height: 22px; border-radius: 50%; background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: var(--text-muted);
}
.sl-user-name { font-weight: 500; white-space: nowrap; }

.sl-event-info { flex: 1; min-width: 0; display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.sl-info-text { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.sl-channel { color: #5ccfee; font-size: 0.82rem; font-weight: 500; }
.sl-by { color: var(--text-muted); font-size: 0.82rem; }
.sl-rule { background: rgba(88,101,242,0.15); color: #5865f2; padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.78rem; font-weight: 600; }

.sl-event-time { color: var(--text-muted); font-size: 0.78rem; white-space: nowrap; flex-shrink: 0; }

.sl-detail-btn {
  background: rgba(88,101,242,0.1); color: var(--accent); border: none; padding: 0.25rem 0.6rem;
  border-radius: 4px; font-size: 0.75rem; font-weight: 600; cursor: pointer;
  transition: background 0.15s; flex-shrink: 0;
}
.sl-detail-btn:hover { background: rgba(88,101,242,0.25); }

/* Pagination */
.sl-pagination {
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  margin-top: 1rem; padding: 0.75rem 0;
}
.sl-page-btn {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  padding: 0.4rem 1rem; border-radius: 6px; cursor: pointer; font-size: 0.85rem;
  transition: border-color 0.15s;
}
.sl-page-btn:hover { border-color: var(--accent); }
.sl-page-info { font-size: 0.85rem; color: var(--text-muted); }

/* Detail modal */
.sl-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); animation: ov-fadeUp 0.2s ease-out;
}
.sl-modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; width: 90%; max-width: 650px; max-height: 80vh;
  display: flex; flex-direction: column; animation: ov-fadeUp 0.25s ease-out;
}
.sl-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.sl-modal-header h3 { margin: 0; font-size: 1rem; }
.sl-modal-close {
  background: none; border: none; color: var(--text-muted); font-size: 1.5rem;
  cursor: pointer; line-height: 1; padding: 0 0.3rem;
}
.sl-modal-close:hover { color: var(--text); }
.sl-modal-body { padding: 1.25rem; overflow-y: auto; }

.sl-detail-grid { display: flex; flex-direction: column; gap: 0.6rem; }
.sl-detail-row { display: flex; align-items: flex-start; gap: 0.75rem; }
.sl-detail-full { flex-direction: column; }
.sl-detail-label {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted); min-width: 110px; flex-shrink: 0;
  padding-top: 0.15rem;
}
.sl-detail-val { font-size: 0.9rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.sl-id-mono { font-family: monospace; font-size: 0.78rem; color: var(--text-muted); }

.sl-content-block {
  background: var(--bg-secondary); border-radius: 6px; padding: 0.6rem 0.8rem;
  font-size: 0.88rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
  max-height: 200px; overflow-y: auto; width: 100%;
}
.sl-diff-old { border-left: 3px solid #ed4245; }
.sl-diff-new { border-left: 3px solid #57f287; }

/* ── Global Modal (shared across pages) ────────────────── */
.cr-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(4px); animation: cr-overlayIn 0.2s ease-out; }
.cr-modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; width: 92%; box-shadow: 0 24px 80px rgba(0,0,0,0.5); animation: ov-fadeUp 0.3s ease-out; }
.cr-modal-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 1.5rem 1.75rem 1.25rem; border-bottom: 1px solid var(--border); }
.cr-modal-header h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.15rem; }
.cr-modal-sub { font-size: 0.82rem; color: var(--text-muted); margin: 0; }
.cr-modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; line-height: 1; width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; transition: all 0.15s; flex-shrink: 0; margin-top: -0.25rem; }
.cr-modal-close:hover { background: rgba(237,66,69,0.1); color: #ed4245; }
.cr-modal-body { padding: 1.75rem; max-height: 62vh; overflow-y: auto; }
.cr-modal-footer { display: flex; justify-content: flex-end; gap: 0.75rem; padding: 1rem 1.75rem 1.25rem; border-top: 1px solid var(--border); }
@keyframes cr-overlayIn { from { opacity: 0; } to { opacity: 1; } }
