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

:root {
  --bg: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161f;
  --bg-elevated: #1c1c28;
  --accent: #6c72cb;
  --accent-hover: #5a5fbf;
  --accent-glow: rgba(108,114,203,0.15);
  --accent-subtle: rgba(108,114,203,0.08);
  --text: #e8e8ed;
  --text-muted: #6b6b80;
  --text-dim: #45455a;
  --border: #1e1e2e;
  --border-subtle: rgba(255,255,255,0.04);
  --success: #4ade80;
  --error: #f43f5e;
  --warning: #fbbf24;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Custom scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.08) transparent; }

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

/* Sidebar layout */
body.has-sidebar { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar {
  width: 224px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  height: 100%;
  overflow-y: auto;
}

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

.sidebar-guild-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
}

.sidebar-guild-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.sidebar-guild-name {
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

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

.sidebar-section-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 0.7rem 0.7rem 0.2rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0.65rem;
  border-radius: 7px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}

.sidebar-link:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.sidebar-link.active { background: var(--accent-subtle); color: var(--accent); }
.sidebar-link.active::before { content:''; position:absolute; left:0; top:50%; transform:translateY(-50%); width:3px; height:60%; background:var(--accent); border-radius:0 3px 3px 0; }
.sidebar-link svg { flex-shrink: 0; opacity: 0.6; width: 15px; height: 15px; }
.sidebar-link.active svg { opacity: 1; }

.page-main {
  flex: 1;
  padding: 1.5rem 2rem 2.5rem;
  min-width: 0;
  overflow-y: auto;
  height: 100%;
}

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

.page-heading h1 { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.03em; color: #fff; }
.page-subtitle { color: var(--text-muted); margin-top: 0.15rem; font-size: 0.8rem; font-weight: 500; }

/* 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: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: rgba(255,255,255,0.08); }

.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 {
  border-bottom: 1px solid var(--border);
  padding: 0 1.25rem;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  flex-shrink: 0;
  backdrop-filter: blur(16px) saturate(1.4);
  background: rgba(10,10,15,0.85);
}

.nav-brand a {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.03em;
}

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

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

.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
}

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

.btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: -0.01em;
}

.btn-primary { background: var(--accent); color: white; box-shadow: 0 1px 4px rgba(108,114,203,0.25); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 2px 12px rgba(108,114,203,0.35); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); border-color: rgba(255,255,255,0.1); }
.btn-outline { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-outline:hover { color: var(--text); border-color: rgba(255,255,255,0.12); background: var(--border-subtle); }
.btn-large { padding: 0.75rem 1.75rem; font-size: 0.92rem; }

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

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

.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: var(--radius-lg);
  padding: 1.75rem;
  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.85rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
  letter-spacing: -0.01em;
}

.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, .data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.channel-table th, .data-table thead th {
  text-align: left;
  padding: 0.65rem 1rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.channel-table td, .data-table td {
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 0.85rem;
}

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

.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); box-shadow: 0 0 8px var(--accent-glow); }
.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.25rem;
}

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

.form-group input, .form-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
  transition: all var(--transition);
}

select.form-input, .form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 2rem;
}
select.form-input option, .form-group select option {
  background: var(--bg-card);
  color: var(--text);
}

.form-group input:focus, .form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.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: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.28rem 0.7rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.sort-btn:hover { border-color: rgba(255,255,255,0.12); color: var(--text); }
.sort-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 6px var(--accent-glow); }

.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; }

/* ── 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;
}

/* ── Sponsorship page ───────────────────────────────────── */
.sp-app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.sp-app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.sp-username {
  font-weight: 600;
  font-size: 1rem;
  display: block;
}
.sp-app-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.sp-status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sp-status-pending { background: rgba(254,231,92,0.15); color: #fee75c; }
.sp-status-approved { background: rgba(87,242,135,0.15); color: #57f287; }
.sp-status-rejected { background: rgba(237,66,69,0.15); color: #ed4245; }

.sp-qa {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}
.sp-question {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}
.sp-answer {
  font-size: 0.9rem;
  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 ─────────────────────────────────── */
.eb-layout { display:grid; grid-template-columns:1fr 1fr; gap:1.5rem; }
@media (max-width:900px) { .eb-layout { grid-template-columns:1fr; } }
.eb-form { display:flex; flex-direction:column; gap:0.75rem; }
.eb-section { background:var(--bg-secondary); border:1px solid var(--border); border-radius:10px; overflow:hidden; }
.eb-section-header { display:flex; justify-content:space-between; align-items:center; padding:0.6rem 0.9rem; cursor:pointer; font-size:0.82rem; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.04em; user-select:none; }
.eb-section-header:hover { color:var(--text); }
.eb-section-header .eb-chevron { transition:transform 0.2s; font-size:0.7rem; }
.eb-section-header.collapsed .eb-chevron { transform:rotate(-90deg); }
.eb-section-body { padding:0.75rem 0.9rem; display:flex; flex-direction:column; gap:0.5rem; border-top:1px solid var(--border); }
.eb-section-body.collapsed { display:none; }

/* Discord-like embed preview */
.eb-preview-wrap { position:sticky; top:1rem; }
.eb-preview { background:#2f3136; border-radius:4px; display:flex; max-width:520px; border-left:4px solid var(--accent); overflow:hidden; }
.eb-preview-content { padding:0.5rem 1rem 0.5rem 0.75rem; flex:1; min-width:0; }
.eb-preview-author { display:flex; align-items:center; gap:0.5rem; margin-bottom:0.25rem; }
.eb-preview-author img { width:24px; height:24px; border-radius:50%; }
.eb-preview-author-name { font-size:0.8rem; font-weight:600; color:#fff; }
.eb-preview-title { font-size:1rem; font-weight:700; color:#00aff4; margin-bottom:0.25rem; }
.eb-preview-title a { color:#00aff4; text-decoration:none; }
.eb-preview-desc { font-size:0.875rem; color:#dcddde; line-height:1.375rem; white-space:pre-wrap; word-wrap:break-word; margin-bottom:0.5rem; }
.eb-preview-fields { display:flex; flex-wrap:wrap; gap:0.25rem 0.5rem; margin-bottom:0.5rem; }
.eb-preview-field { min-width:0; }
.eb-preview-field.inline { flex:1; min-width:120px; }
.eb-preview-field:not(.inline) { width:100%; }
.eb-preview-field-name { font-size:0.8rem; font-weight:700; color:#fff; margin-bottom:0.1rem; }
.eb-preview-field-value { font-size:0.8rem; color:#dcddde; line-height:1.125rem; white-space:pre-wrap; }
.eb-preview-image { max-width:100%; border-radius:4px; margin-top:0.5rem; max-height:300px; }
.eb-preview-thumbnail { width:80px; height:80px; border-radius:4px; object-fit:cover; margin:0.5rem 1rem 0 0; flex-shrink:0; }
.eb-preview-footer { display:flex; align-items:center; gap:0.5rem; margin-top:0.5rem; font-size:0.75rem; color:#72767d; }
.eb-preview-footer img { width:20px; height:20px; border-radius:50%; }

.eb-field-row { display:flex; gap:0.5rem; align-items:flex-start; background:var(--bg-card); padding:0.5rem; border-radius:6px; }
.eb-field-row .form-input { font-size:0.82rem; padding:0.35rem 0.5rem; }
.eb-field-remove { background:none; border:none; color:var(--error); cursor:pointer; font-size:1.2rem; padding:0.2rem; flex-shrink:0; margin-top:0.2rem; }

.eb-actions { display:flex; gap:0.5rem; flex-wrap:wrap; margin-top:0.5rem; }

.eb-tpl-bar { display:flex; gap:0.5rem; align-items:center; flex-wrap:wrap; margin-bottom:0.75rem; }
.eb-tpl-bar select { flex:1; min-width:140px; }
.eb-json-bar { display:flex; gap:0.5rem; margin-top:0.75rem; }
.eb-empty-preview { color:#72767d; font-size:0.85rem; padding:1.5rem; text-align:center; }

.btn-danger { background: rgba(244,63,94,0.12); color: var(--error); border: 1px solid rgba(244,63,94,0.2); }
.btn-danger:hover { background: rgba(244,63,94,0.2); border-color: rgba(244,63,94,0.3); }

/* ── 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: var(--radius);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all var(--transition);
  animation: ov-fadeUp 0.4s ease-out both;
}
.ov-stat-card:hover { border-color: rgba(255,255,255,0.08); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

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

.ov-stat-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-glow);
  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: var(--radius-lg);
  padding: 1.25rem;
  animation: ov-fadeUp 0.5s ease-out both;
  transition: border-color var(--transition);
}
.ov-chart-card:hover { border-color: rgba(255,255,255,0.06); }
.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); }
}

/* ── Global Modals ──────────────────────────────────── */
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.75); display:flex; align-items:center; justify-content:center; z-index:1000; backdrop-filter:blur(8px); animation:cr-overlayIn 0.2s ease-out; }
.modal-card { background:var(--bg-elevated); border:1px solid var(--border); border-radius:var(--radius-lg); width:92%; box-shadow:var(--shadow-lg); animation:ov-fadeUp 0.25s ease-out; }
.modal-header { display:flex; justify-content:space-between; align-items:center; padding:1.25rem 1.5rem 1rem; border-bottom:1px solid var(--border); }
.modal-header h2 { font-size:1.1rem; font-weight:700; letter-spacing:-0.02em; }
.modal-close { background:none; border:none; color:var(--text-muted); font-size:1.3rem; cursor:pointer; line-height:1; width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center; transition:all var(--transition); }
.modal-close:hover { background:rgba(244,63,94,0.1); color:var(--error); }
.modal-body { padding:1.5rem; max-height:70vh; overflow-y:auto; }
.modal-footer { display:flex; justify-content:flex-end; gap:0.6rem; padding:0.85rem 1.5rem 1rem; border-top:1px solid var(--border); }

/* ── Activity Feed ──────────────────────────────────── */
.activity-feed { max-height:350px; overflow-y:auto; display:flex; flex-direction:column; gap:0; padding-right:0.4rem; }
.feed-item { display:flex; align-items:center; gap:0.6rem; padding:0.5rem 0.6rem; border-bottom:1px solid var(--border); font-size:0.85rem; animation:ov-slideIn 0.3s ease-out both; transition:background 0.2s; }
.feed-item:hover { background:rgba(255,255,255,0.02); }
.feed-item:last-child { border-bottom:none; }
.feed-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.feed-time { font-size:0.75rem; color:var(--text-muted); min-width:55px; flex-shrink:0; }
.feed-text { flex:1; color:var(--text); }
.feed-text strong { color:#fff; font-weight:600; }
.feed-new { background:rgba(88,101,242,0.06); }

/* ── Auto Responder ─────────────────────────────────── */
.ar-list { display:flex; flex-direction:column; gap:0.75rem; }
.ar-card { background:var(--bg-card); border:1px solid var(--border); border-radius:10px; padding:1rem 1.25rem; transition:border-color 0.2s; }
.ar-card:hover { border-color:rgba(88,101,242,0.3); }
.ar-disabled { opacity:0.5; }
.ar-card-header { display:flex; justify-content:space-between; align-items:center; gap:1rem; flex-wrap:wrap; }
.ar-card-title { display:flex; align-items:center; gap:0.6rem; flex-wrap:wrap; }
.ar-card-title strong { font-size:1rem; }
.ar-card-actions { display:flex; align-items:center; gap:0.5rem; }
.ar-type-badge { font-size:0.7rem; padding:0.15rem 0.5rem; border-radius:4px; text-transform:uppercase; font-weight:700; background:rgba(88,101,242,0.15); color:var(--accent); }
.ar-stats { font-size:0.8rem; color:var(--text-muted); }
.ar-card-body { margin-top:0.5rem; display:flex; flex-direction:column; gap:0.2rem; font-size:0.85rem; color:var(--text-muted); }
.ar-card-body code { background:var(--bg-secondary); padding:0.1rem 0.4rem; border-radius:3px; font-size:0.8rem; }

/* Badges */
.badge { font-size:0.72rem; padding:0.15rem 0.5rem; border-radius:4px; font-weight:600; background:var(--bg-secondary); color:var(--text-muted); }
.badge-warning { background:rgba(254,231,92,0.15); color:#fee75c; }
.badge-success { background:rgba(87,242,135,0.15); color:#57f287; }
.badge-info { background:rgba(88,101,242,0.15); color:#5865f2; }
.badge-error { background:rgba(237,66,69,0.15); color:#ed4245; }

/* ── 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; } }

/* ── Helper Stats Cards ─────────────────────────────── */
.hs-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:1rem; }
.hs-card { background:var(--bg-secondary); border:1px solid var(--border); border-radius:var(--radius-lg); padding:1.25rem; animation:ov-fadeUp 0.5s ease-out both; transition:border-color var(--transition), transform var(--transition); }
.hs-card:hover { border-color:rgba(255,255,255,0.08); transform:translateY(-2px); }
.hs-card-top { display:flex; flex-direction:column; align-items:center; text-align:center; gap:0.4rem; margin-bottom:1rem; position:relative; }
.hs-rank { position:absolute; top:0; left:0; font-size:0.75rem; font-weight:800; color:var(--text-dim); background:var(--bg-card); padding:0.15rem 0.5rem; border-radius:6px; }
.hs-avatar-wrap { width:56px; height:56px; }
.hs-avatar { width:56px; height:56px; border-radius:50%; object-fit:cover; border:2px solid var(--border); }
.hs-avatar-ph { display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg, var(--accent), #8b5cf6); color:#fff; font-weight:700; font-size:1.3rem; }
.hs-name { font-size:1rem; font-weight:700; color:var(--text); }
.hs-role-badge { font-size:0.68rem; padding:0.15rem 0.55rem; border-radius:5px; font-weight:700; text-transform:uppercase; letter-spacing:0.04em; }
.hs-stats-grid { display:grid; grid-template-columns:1fr 1fr; gap:0.4rem; margin-bottom:1rem; }
.hs-mini-stat { display:flex; flex-direction:column; align-items:center; padding:0.45rem; background:var(--bg-card); border-radius:8px; }
.hs-mini-val { font-size:1.05rem; font-weight:700; color:var(--text); }
.hs-mini-label { font-size:0.62rem; color:var(--text-dim); text-transform:uppercase; letter-spacing:0.05em; font-weight:600; }
.hs-bar-section { display:flex; flex-direction:column; gap:0.35rem; }
.hs-bar-row { display:flex; align-items:center; gap:0.5rem; }
.hs-bar-label { font-size:0.7rem; color:var(--text-dim); min-width:55px; font-weight:500; }
.hs-bar-track { flex:1; height:5px; background:var(--bg-card); border-radius:3px; overflow:hidden; }
.hs-bar-fill { height:100%; border-radius:3px; transition:width 0.8s ease-out; }
.hs-bar-val { font-size:0.72rem; font-weight:700; color:var(--text-muted); min-width:35px; text-align:right; }

/* ── Mobile Responsive ─────────────────────────────── */
.sidebar-toggle { display:none; background:none; border:none; color:var(--text); cursor:pointer; padding:0.5rem; }

@media (max-width: 768px) {
  .layout { flex-direction: column; }

  .sidebar {
    position: fixed; left: -260px; top: 52px; width: 250px; height: calc(100vh - 52px);
    z-index: 200; transition: left 0.25s ease; box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }
  .sidebar.open { left: 0; }
  .sidebar-backdrop { display:none; position:fixed; inset:0; top:52px; background:rgba(0,0,0,0.5); z-index:199; }
  .sidebar-backdrop.open { display:block; }

  .sidebar-toggle { display:flex; align-items:center; justify-content:center; }

  .page-main { padding: 1rem; }
  .page-heading h1 { font-size: 1.15rem; }

  .ov-stat-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap:0.5rem; }
  .ov-charts-grid { grid-template-columns: 1fr; }
  .ov-chart-wide { grid-column: span 1; }
  .ov-charts-3col { grid-template-columns: 1fr; }

  .nav-links { gap: 0.5rem; }
  .nav-brand a { font-size: 1.1rem; }

  .modal-card, .cr-modal { width: 96%; max-width: none; }
  .modal-body, .cr-modal-body { padding: 1rem; }

  .data-table { font-size: 0.78rem; }
  .settings-form { max-width: 100%; }
  .form-row { flex-direction: column; }

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

@media (max-width: 480px) {
  .navbar { padding: 0 0.75rem; height: 48px; }
  .page-main { padding: 0.75rem; }
  .ov-stat-grid { grid-template-columns: 1fr 1fr; }
  .ov-stat-card { padding: 0.6rem 0.7rem; }
  .nav-user span, .btn-outline { display: none; }
}

/* ── MrBigCreator additions ─────────────────────────── */
.mb-toasts { position:fixed; right:1.25rem; bottom:1.25rem; display:flex; flex-direction:column; gap:0.5rem; z-index:2000; }
.mb-toast { background:var(--bg-elevated); border:1px solid var(--border); border-left:3px solid var(--success); border-radius:8px; padding:0.65rem 1rem; font-size:0.86rem; box-shadow:var(--shadow-md); max-width:360px; animation:ov-fadeUp 0.25s ease-out; transition:opacity 0.3s; }
.mb-toast-error { border-left-color:var(--error); }
.mb-toast-info { border-left-color:var(--accent); }
.mb-toast-out { opacity:0; }
.sidebar-count { margin-left:auto; background:#fee75c; color:#111; font-size:0.65rem; font-weight:800; min-width:18px; height:18px; border-radius:9px; display:inline-flex; align-items:center; justify-content:center; padding:0 5px; }
.nav-role { font-size:0.65rem; font-weight:700; text-transform:uppercase; letter-spacing:0.04em; padding:0.1rem 0.4rem; border-radius:4px; background:var(--accent-glow); color:var(--accent); }
.mb-setup { background:rgba(254,231,92,0.06); border:1px solid rgba(254,231,92,0.25); border-radius:var(--radius); padding:0.9rem 1.1rem; margin-bottom:1.25rem; font-size:0.88rem; }
.mb-setup ul { margin:0.4rem 0 0 1.1rem; color:var(--text-muted); }
.mb-setup a { color:var(--accent); }
.mb-progress { height:6px; background:var(--bg-secondary); border-radius:3px; overflow:hidden; margin-top:0.4rem; }
.mb-progress > div { height:100%; background:var(--accent); transition:width 0.4s; }
.mb-dropdown { position:relative; }
.mb-dropdown-menu { display:none; position:absolute; right:0; top:calc(100% + 0.35rem); min-width:260px; background:var(--bg-elevated); border:1px solid var(--border); border-radius:10px; box-shadow:var(--shadow-lg); z-index:50; padding:0.35rem; }
.mb-dropdown.open .mb-dropdown-menu { display:block; }
.mb-dropdown-menu button { display:block; width:100%; text-align:left; background:none; border:none; color:var(--text); padding:0.55rem 0.75rem; border-radius:7px; font-size:0.85rem; cursor:pointer; font-family:inherit; }
.mb-dropdown-menu button:hover { background:var(--accent-subtle); }
.mb-dropdown-menu small { display:block; color:var(--text-muted); font-size:0.74rem; margin-top:0.1rem; }
.alert { padding:0.75rem 1rem; border-radius:var(--radius); margin:1.25rem 0; font-size:0.9rem; border:1px solid var(--border); }
.alert-error { background:rgba(244,63,94,0.1); border-color:rgba(244,63,94,0.3); color:var(--error); }
