/* ============================================================
   ZENCORD - Complete UI Stylesheet
   ============================================================ */

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

:root {
  --bg-primary: #0d0e13;
  --bg-secondary: #13141b;
  --bg-tertiary: #1a1b25;
  --bg-elevated: #21222e;
  --bg-hover: #2a2b3a;
  --bg-active: #313244;
  --bg-input: #16171f;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);

  --accent: #6C63FF;
  --accent-hover: #7d75ff;
  --accent-light: rgba(108,99,255,0.15);
  --accent-glow: rgba(108,99,255,0.3);
  --danger: #ef4444;
  --danger-hover: #f87171;
  --danger-light: rgba(239,68,68,0.15);
  --success: #22c55e;
  --success-light: rgba(34,197,94,0.15);
  --warning: #f59e0b;
  --warning-light: rgba(245,158,11,0.15);
  --partner: #f0b429;
  --partner-light: rgba(240,180,41,0.15);

  --text-primary: #e8e9f3;
  --text-secondary: #9899b3;
  --text-muted: #5a5b72;
  --text-link: #818cf8;

  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 30px var(--accent-glow);

  --sidebar-width: 240px;
  --server-rail-width: 68px;
  --members-width: 220px;
  --transition: 0.18s cubic-bezier(0.4,0,0.2,1);
}

html, body { height: 100%; overflow: hidden; background: var(--bg-primary); color: var(--text-primary); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }

#app { height: 100%; display: flex; flex-direction: column; }

/* ============================================================
   SPLASH SCREEN
   ============================================================ */
.splash-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; gap: 32px; background: var(--bg-primary); }
.splash-logo { display: flex; align-items: center; gap: 14px; }
.splash-icon { width: 64px; height: 64px; background: linear-gradient(135deg, var(--accent), #a78bfa); border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 800; color: white; box-shadow: var(--shadow-glow); animation: pulse-glow 2s ease-in-out infinite; }
.splash-name { font-size: 32px; font-weight: 800; background: linear-gradient(135deg, #fff, #a78bfa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: -0.5px; }
.splash-loader { width: 200px; height: 3px; background: var(--bg-elevated); border-radius: 99px; overflow: hidden; }
.loader-bar { height: 100%; width: 40%; background: linear-gradient(90deg, var(--accent), #a78bfa); border-radius: 99px; animation: loader-slide 1.2s ease-in-out infinite; }
@keyframes loader-slide { 0% { transform: translateX(-150%); } 100% { transform: translateX(350%); } }
@keyframes pulse-glow { 0%,100% { box-shadow: 0 0 20px var(--accent-glow); } 50% { box-shadow: 0 0 50px var(--accent-glow); } }

/* ============================================================
   TOS PAGE
   ============================================================ */
.tos-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; background: var(--bg-primary); padding: 40px 20px; overflow-y: auto; }
.tos-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.tos-logo-icon { width: 48px; height: 48px; background: linear-gradient(135deg, var(--accent), #a78bfa); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; color: white; }
.tos-logo-name { font-size: 24px; font-weight: 800; background: linear-gradient(135deg, #fff, #a78bfa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.tos-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 32px; max-width: 720px; width: 100%; }
.tos-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.tos-card .tos-meta { color: var(--text-secondary); font-size: 13px; margin-bottom: 24px; }
.tos-content { height: 400px; overflow-y: auto; padding-right: 8px; margin-bottom: 24px; color: var(--text-secondary); line-height: 1.8; }
.tos-content::-webkit-scrollbar { width: 4px; }
.tos-content::-webkit-scrollbar-thumb { background: var(--bg-active); border-radius: 99px; }
.tos-content h2 { color: var(--text-primary); font-size: 16px; margin: 20px 0 8px; font-weight: 600; }
.tos-content p { margin-bottom: 12px; font-size: 14px; }
.tos-accept { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--bg-tertiary); border-radius: var(--radius); margin-bottom: 20px; opacity: 0.5; transition: opacity var(--transition); }
.tos-accept.enabled { opacity: 1; cursor: pointer; }
.tos-accept.enabled:hover { background: var(--accent-light); }
.tos-checkbox { width: 20px; height: 20px; border: 2px solid var(--border-hover); border-radius: 5px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all var(--transition); }
.tos-accept.checked .tos-checkbox { background: var(--accent); border-color: var(--accent); }
.tos-accept.checked .tos-checkbox::after { content: '✓'; color: white; font-size: 13px; font-weight: 700; }
.tos-note { color: var(--text-muted); font-size: 12px; text-align: center; margin-top: 12px; }

/* ============================================================
   AUTH PAGE
   ============================================================ */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-primary); padding: 20px; overflow: auto; }
.auth-page::before { content: ''; position: fixed; inset: 0; background: radial-gradient(ellipse at 30% 50%, rgba(108,99,255,0.08) 0%, transparent 60%), radial-gradient(ellipse at 70% 20%, rgba(167,139,250,0.06) 0%, transparent 50%); pointer-events: none; }
.auth-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 40px; width: 100%; max-width: 420px; position: relative; z-index: 1; }
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-logo-icon { width: 44px; height: 44px; background: linear-gradient(135deg, var(--accent), #a78bfa); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; color: white; }
.auth-logo-name { font-size: 22px; font-weight: 800; background: linear-gradient(135deg, #fff, #a78bfa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.auth-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.auth-card .auth-sub { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }
.auth-tabs { display: flex; gap: 2px; background: var(--bg-tertiary); padding: 3px; border-radius: var(--radius-sm); margin-bottom: 24px; }
.auth-tab { flex: 1; padding: 8px; text-align: center; border-radius: 5px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text-secondary); transition: all var(--transition); }
.auth-tab.active { background: var(--bg-elevated); color: var(--text-primary); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-secondary); margin-bottom: 7px; }
.form-input { width: 100%; background: var(--bg-input); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; font-family: var(--font); font-size: 14px; color: var(--text-primary); transition: all var(--transition); outline: none; }
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.form-input::placeholder { color: var(--text-muted); }
.form-input.error { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-light); }
.form-error { color: var(--danger); font-size: 12px; margin-top: 5px; }
.form-hint { color: var(--text-muted); font-size: 12px; margin-top: 5px; }
textarea.form-input { resize: vertical; min-height: 80px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239899b3' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 18px; border-radius: var(--radius-sm); border: none; font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer; transition: all var(--transition); text-decoration: none; white-space: nowrap; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 16px var(--accent-glow); }
.btn-secondary { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--border-hover); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 13px 24px; font-size: 15px; border-radius: var(--radius); }
.btn-full { width: 100%; }
.btn-loading { position: relative; pointer-events: none; }
.btn-loading::after { content: ''; position: absolute; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-layout { display: flex; height: 100vh; overflow: hidden; }
.server-rail { width: var(--server-rail-width); background: var(--bg-primary); display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 6px; overflow-y: auto; flex-shrink: 0; border-right: 1px solid var(--border); }
.server-rail::-webkit-scrollbar { display: none; }
.server-rail-divider { width: 32px; height: 1px; background: var(--border); margin: 3px 0; }
.server-icon { width: 44px; height: 44px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; cursor: pointer; transition: all var(--transition); position: relative; flex-shrink: 0; color: white; overflow: hidden; }
.server-icon:hover { border-radius: 12px; transform: scale(1.05); }
.server-icon.active { border-radius: 12px; }
.server-icon.active::before { content: ''; position: absolute; left: -6px; top: 50%; transform: translateY(-50%); width: 3px; height: 28px; background: var(--text-primary); border-radius: 0 3px 3px 0; }
.server-icon-img { width: 100%; height: 100%; object-fit: cover; }
.server-icon-add { background: var(--bg-tertiary); color: var(--accent); font-size: 22px; font-weight: 300; }
.server-icon-add:hover { background: var(--accent); color: white; }
.server-icon-badge { position: absolute; bottom: -2px; right: -2px; width: 16px; height: 16px; background: var(--accent); border-radius: 50%; border: 2px solid var(--bg-primary); display: flex; align-items: center; justify-content: center; }
.server-icon-badge.verified { background: var(--success); }
.server-icon-badge.partner { background: var(--partner); }

/* Sidebar */
.sidebar { width: var(--sidebar-width); background: var(--bg-secondary); display: flex; flex-direction: column; flex-shrink: 0; border-right: 1px solid var(--border); }
.sidebar-header { padding: 0 12px; height: 52px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); cursor: pointer; flex-shrink: 0; }
.sidebar-header:hover { background: var(--bg-hover); }
.sidebar-header-name { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-channels { flex: 1; overflow-y: auto; padding: 8px 0; }
.sidebar-channels::-webkit-scrollbar { width: 4px; }
.sidebar-channels::-webkit-scrollbar-thumb { background: var(--bg-active); border-radius: 99px; }
.channel-category { padding: 16px 8px 4px 12px; font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--text-muted); text-transform: uppercase; display: flex; align-items: center; justify-content: space-between; }
.channel-category-btn { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); border-radius: 4px; transition: all var(--transition); cursor: pointer; font-size: 14px; }
.channel-category-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.channel-item { display: flex; align-items: center; gap: 7px; padding: 5px 8px 5px 12px; margin: 0 4px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-secondary); transition: all var(--transition); font-size: 14px; font-weight: 500; }
.channel-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.channel-item.active { background: var(--bg-active); color: var(--text-primary); }
.channel-icon { flex-shrink: 0; font-size: 16px; color: var(--text-muted); }
.channel-item.active .channel-icon { color: var(--text-primary); }
.channel-actions { margin-left: auto; display: none; gap: 2px; }
.channel-item:hover .channel-actions { display: flex; }
.channel-action-btn { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 4px; font-size: 13px; color: var(--text-secondary); transition: all var(--transition); }
.channel-action-btn:hover { color: var(--text-primary); background: var(--bg-active); }
.sidebar-user { padding: 8px 12px; background: var(--bg-primary); border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-status { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.sidebar-user-actions { display: flex; gap: 2px; }
.sidebar-action-btn { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); color: var(--text-secondary); cursor: pointer; transition: all var(--transition); font-size: 16px; }
.sidebar-action-btn:hover { color: var(--text-primary); background: var(--bg-hover); }

/* ============================================================
   MAIN CHAT AREA
   ============================================================ */
.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg-primary); }
.channel-header { height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); background: var(--bg-secondary); flex-shrink: 0; }
.channel-header-icon { font-size: 18px; color: var(--text-secondary); }
.channel-header-name { font-size: 15px; font-weight: 700; }
.channel-header-desc { font-size: 13px; color: var(--text-secondary); margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-header-actions { margin-left: auto; display: flex; gap: 4px; }
.header-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); color: var(--text-secondary); cursor: pointer; transition: all var(--transition); font-size: 17px; }
.header-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.header-btn.active { color: var(--accent); }

.messages-area { flex: 1; overflow-y: auto; padding: 16px 16px 0; display: flex; flex-direction: column; gap: 2px; scroll-behavior: smooth; }
.messages-area::-webkit-scrollbar { width: 6px; }
.messages-area::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 99px; }

.message-group { display: flex; gap: 14px; padding: 3px 0; }
.message-group:hover { background: rgba(255,255,255,0.02); border-radius: var(--radius-sm); }
.msg-avatar { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; flex-shrink: 0; margin-top: 2px; cursor: pointer; transition: opacity var(--transition); overflow: hidden; }
.msg-avatar:hover { opacity: 0.85; }
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg-body { flex: 1; min-width: 0; }
.msg-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; flex-wrap: wrap; }
.msg-author { font-size: 14px; font-weight: 700; cursor: pointer; }
.msg-author:hover { text-decoration: underline; }
.msg-time { font-size: 11px; color: var(--text-muted); font-family: var(--mono); }
.msg-badge { font-size: 10px; padding: 1px 6px; border-radius: var(--radius-full); font-weight: 700; letter-spacing: 0.5px; }
.badge-staff { background: var(--danger-light); color: var(--danger); }
.badge-verified { background: var(--success-light); color: var(--success); }
.badge-partner { background: var(--partner-light); color: var(--partner); }
.badge-early { background: var(--accent-light); color: var(--accent); }
.badge-active { background: rgba(34,197,94,0.12); color: #4ade80; }
.msg-content { font-size: 14px; line-height: 1.6; word-break: break-word; color: var(--text-primary); }
.msg-content.deleted { color: var(--text-muted); font-style: italic; }
.msg-edited { font-size: 11px; color: var(--text-muted); margin-left: 4px; }
.message-continued { margin-left: 52px; }
.message-continued .msg-content { font-size: 14px; line-height: 1.6; }
.message-continued:hover { background: rgba(255,255,255,0.02); border-radius: var(--radius-sm); }

.msg-reply { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; padding: 4px 8px; background: var(--bg-tertiary); border-left: 2px solid var(--text-muted); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; cursor: pointer; font-size: 12px; color: var(--text-secondary); max-width: 500px; overflow: hidden; }
.msg-reply:hover { color: var(--text-primary); background: var(--bg-elevated); }
.msg-reply-author { font-weight: 700; color: var(--text-primary); flex-shrink: 0; }
.msg-reply-content { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.msg-actions { display: none; position: absolute; right: 12px; top: -16px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; display: flex; gap: 2px; box-shadow: var(--shadow); z-index: 10; }
.message-group { position: relative; }
.message-group:hover .msg-actions-bar { opacity: 1; }
.msg-actions-bar { position: absolute; right: 12px; top: 4px; opacity: 0; transition: opacity var(--transition); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; display: flex; gap: 2px; box-shadow: var(--shadow); z-index: 5; }
.msg-action-btn { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--text-secondary); cursor: pointer; transition: all var(--transition); font-size: 14px; }
.msg-action-btn:hover { color: var(--text-primary); background: var(--bg-active); }
.msg-action-btn.danger:hover { color: var(--danger); }

.load-more-btn { text-align: center; padding: 8px; color: var(--text-link); font-size: 13px; cursor: pointer; }
.load-more-btn:hover { text-decoration: underline; }

/* New messages date separator */
.msg-date-sep { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.msg-date-sep::before, .msg-date-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.msg-date-sep span { font-size: 12px; color: var(--text-muted); white-space: nowrap; font-weight: 600; }

/* Message input */
.input-area { padding: 12px 16px 16px; flex-shrink: 0; }
.input-wrapper { background: var(--bg-elevated); border: 1.5px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: border-color var(--transition); }
.input-wrapper:focus-within { border-color: var(--border-hover); }
.reply-preview { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--bg-tertiary); border-bottom: 1px solid var(--border); }
.reply-preview-text { flex: 1; font-size: 13px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-preview-text strong { color: var(--text-primary); }
.reply-dismiss { color: var(--text-muted); cursor: pointer; font-size: 18px; transition: color var(--transition); }
.reply-dismiss:hover { color: var(--danger); }
.input-row { display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px; }
.msg-textarea { flex: 1; background: transparent; border: none; outline: none; color: var(--text-primary); font-family: var(--font); font-size: 14px; resize: none; max-height: 200px; overflow-y: auto; line-height: 1.5; }
.msg-textarea::placeholder { color: var(--text-muted); }
.msg-textarea::-webkit-scrollbar { width: 3px; }
.input-send-btn { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); border: none; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--transition); flex-shrink: 0; font-size: 16px; }
.input-send-btn:hover { background: var(--accent-hover); transform: scale(1.05); }
.input-send-btn:disabled { opacity: 0.4; cursor: default; transform: none; }

/* ============================================================
   MEMBERS SIDEBAR
   ============================================================ */
.members-sidebar { width: var(--members-width); background: var(--bg-secondary); border-left: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; }
.members-sidebar-header { padding: 0 12px; height: 52px; display: flex; align-items: center; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-secondary); gap: 6px; }
.members-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.members-list::-webkit-scrollbar { width: 4px; }
.members-list::-webkit-scrollbar-thumb { background: var(--bg-active); border-radius: 99px; }
.member-category { padding: 12px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--text-muted); text-transform: uppercase; }
.member-item { display: flex; align-items: center; gap: 9px; padding: 5px 12px; cursor: pointer; border-radius: var(--radius-sm); margin: 0 4px; transition: background var(--transition); }
.member-item:hover { background: var(--bg-hover); }
.member-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; position: relative; overflow: hidden; }
.member-avatar img { width: 100%; height: 100%; object-fit: cover; }
.online-dot { position: absolute; bottom: 0; right: 0; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bg-secondary); }
.online-dot.online { background: var(--success); }
.online-dot.offline { background: var(--text-muted); }
.member-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-name.offline { opacity: 0.5; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; animation: fade-in 0.15s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 28px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; animation: slide-up 0.2s cubic-bezier(0.4,0,0.2,1); position: relative; }
.modal-lg { max-width: 640px; }
.modal-xl { max-width: 800px; }
@keyframes slide-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.modal-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-secondary); transition: all var(--transition); font-size: 20px; }
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal h2 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.modal .modal-sub { color: var(--text-secondary); font-size: 13px; margin-bottom: 22px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.modal-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.modal-tab { padding: 8px 16px; font-size: 14px; font-weight: 600; color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent; transition: all var(--transition); }
.modal-tab.active { color: var(--text-primary); border-bottom-color: var(--accent); }

/* ============================================================
   PROFILE
   ============================================================ */
.profile-banner { height: 80px; background: linear-gradient(135deg, var(--accent), #a78bfa); border-radius: var(--radius-lg) var(--radius-lg) 0 0; margin: -28px -28px 0; }
.profile-avatar-wrap { position: relative; display: inline-block; margin-top: -28px; margin-left: 20px; }
.profile-avatar { width: 72px; height: 72px; border-radius: 50%; border: 4px solid var(--bg-secondary); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; overflow: hidden; color: white; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-online { position: absolute; bottom: 4px; right: 4px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--bg-secondary); }
.profile-info { padding: 12px 20px 20px; }
.profile-display-name { font-size: 18px; font-weight: 800; }
.profile-username { font-size: 14px; color: var(--text-secondary); }
.profile-pronouns { font-size: 13px; color: var(--text-secondary); margin-top: 2px; font-style: italic; }
.profile-badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.profile-badge { width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 13px; cursor: default; position: relative; }
.profile-badge:hover::after { content: attr(data-title); position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%); background: var(--bg-elevated); padding: 4px 8px; border-radius: var(--radius-sm); font-size: 12px; white-space: nowrap; pointer-events: none; border: 1px solid var(--border); z-index: 999; }
.profile-bio { font-size: 14px; color: var(--text-secondary); margin: 12px 0; line-height: 1.6; }
.profile-divider { height: 1px; background: var(--border); margin: 16px 0; }
.profile-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 10px; }

/* ============================================================
   DISCOVERY
   ============================================================ */
.discovery-page { flex: 1; overflow-y: auto; }
.discovery-page::-webkit-scrollbar { width: 6px; }
.discovery-page::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 99px; }
.discovery-hero { background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary)); padding: 48px 32px 32px; border-bottom: 1px solid var(--border); }
.discovery-hero h1 { font-size: 28px; font-weight: 800; margin-bottom: 8px; background: linear-gradient(135deg, #fff, #a78bfa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.discovery-hero p { color: var(--text-secondary); font-size: 15px; margin-bottom: 20px; }
.discovery-search { display: flex; align-items: center; gap: 10px; background: var(--bg-input); border: 1.5px solid var(--border); border-radius: var(--radius-full); padding: 10px 18px; max-width: 480px; transition: all var(--transition); }
.discovery-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.discovery-search input { flex: 1; background: transparent; border: none; outline: none; color: var(--text-primary); font-family: var(--font); font-size: 14px; }
.discovery-tabs { display: flex; gap: 4px; padding: 16px 32px 0; border-bottom: 1px solid var(--border); background: var(--bg-secondary); }
.disc-tab { padding: 10px 18px; font-size: 14px; font-weight: 600; color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent; transition: all var(--transition); }
.disc-tab.active { color: var(--text-primary); border-bottom-color: var(--accent); }
.discovery-content { padding: 24px 32px; }
.disc-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.disc-section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 32px; }
.server-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; cursor: pointer; transition: all var(--transition); }
.server-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow); }
.server-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.server-card-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: white; flex-shrink: 0; overflow: hidden; }
.server-card-icon img { width: 100%; height: 100%; object-fit: cover; }
.server-card-name { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-card-badges { display: flex; gap: 4px; margin-top: 3px; }
.sc-badge { font-size: 10px; padding: 1px 7px; border-radius: var(--radius-full); font-weight: 700; letter-spacing: 0.4px; }
.sc-badge-verified { background: var(--success-light); color: var(--success); }
.sc-badge-partner { background: var(--partner-light); color: var(--partner); }
.server-card-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 12px; }
.server-card-stats { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); }
.sc-stat { display: flex; align-items: center; gap: 4px; }
.sc-stat-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); }
.sc-stat-dot.online { background: var(--success); }

/* Spotlight */
.spotlight-card { background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary)); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 24px; margin-bottom: 32px; display: flex; gap: 20px; align-items: center; cursor: pointer; transition: all var(--transition); }
.spotlight-card:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.spotlight-icon { width: 72px; height: 72px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 700; color: white; flex-shrink: 0; }
.spotlight-info { flex: 1; }
.spotlight-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); margin-bottom: 6px; }
.spotlight-name { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.spotlight-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }
.spotlight-stats { display: flex; gap: 20px; }
.spotlight-stat { font-size: 14px; display: flex; align-items: center; gap: 6px; }

/* ============================================================
   USER DISCOVERY
   ============================================================ */
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.user-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; cursor: pointer; transition: all var(--transition); text-align: center; }
.user-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.user-card-avatar { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; margin: 0 auto 12px; position: relative; overflow: hidden; }
.user-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-card-online { position: absolute; bottom: 2px; right: 2px; width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid var(--bg-secondary); }
.user-card-name { font-size: 14px; font-weight: 700; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card-username { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.user-card-bio { font-size: 12px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 12px; }
.user-card-stats { display: flex; justify-content: center; gap: 16px; font-size: 12px; color: var(--text-secondary); }

/* Friends list */
.friends-tabs { display: flex; gap: 4px; margin-bottom: 16px; background: var(--bg-tertiary); padding: 3px; border-radius: var(--radius); }
.friend-tab { flex: 1; padding: 7px; text-align: center; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text-secondary); transition: all var(--transition); }
.friend-tab.active { background: var(--bg-elevated); color: var(--text-primary); }
.friend-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--radius); background: var(--bg-secondary); margin-bottom: 8px; border: 1px solid var(--border); transition: all var(--transition); }
.friend-item:hover { border-color: var(--border-hover); }
.friend-avatar { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; position: relative; overflow: hidden; flex-shrink: 0; }
.friend-avatar img { width: 100%; height: 100%; object-fit: cover; }
.friend-info { flex: 1; min-width: 0; }
.friend-name { font-size: 14px; font-weight: 700; }
.friend-status { font-size: 12px; color: var(--text-secondary); }
.friend-actions { display: flex; gap: 6px; }
.friend-btn { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; cursor: pointer; transition: all var(--transition); }
.friend-btn.accept { background: var(--success-light); color: var(--success); }
.friend-btn.accept:hover { background: var(--success); color: white; }
.friend-btn.reject { background: var(--danger-light); color: var(--danger); }
.friend-btn.reject:hover { background: var(--danger); color: white; }
.friend-btn.msg { background: var(--accent-light); color: var(--accent); }
.friend-btn.msg:hover { background: var(--accent); color: white; }
.friend-btn.remove { background: var(--bg-elevated); color: var(--text-secondary); }
.friend-btn.remove:hover { background: var(--danger-light); color: var(--danger); }

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.admin-layout { display: flex; height: 100%; }
.admin-nav { width: 220px; background: var(--bg-secondary); border-right: 1px solid var(--border); padding: 16px 0; flex-shrink: 0; }
.admin-nav-title { padding: 0 16px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.admin-nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 16px; cursor: pointer; color: var(--text-secondary); font-size: 14px; font-weight: 500; transition: all var(--transition); border-radius: 0; }
.admin-nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.admin-nav-item.active { background: var(--accent-light); color: var(--accent); font-weight: 600; border-right: 2px solid var(--accent); }
.admin-content { flex: 1; overflow-y: auto; padding: 28px; }
.admin-content::-webkit-scrollbar { width: 6px; }
.admin-content::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 99px; }
.admin-header { margin-bottom: 24px; }
.admin-header h1 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.admin-header p { color: var(--text-secondary); font-size: 14px; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 28px; }
.admin-stat { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; }
.admin-stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 600; margin-bottom: 8px; }
.admin-stat-value { font-size: 26px; font-weight: 800; }
.admin-stat-value.danger { color: var(--danger); }
.admin-stat-value.success { color: var(--success); }
.admin-stat-value.warning { color: var(--warning); }
.admin-table { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.admin-table table { width: 100%; border-collapse: collapse; }
.admin-table th { padding: 12px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-secondary); border-bottom: 1px solid var(--border); text-align: left; background: var(--bg-tertiary); }
.admin-table td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-hover); }
.admin-search { display: flex; gap: 10px; margin-bottom: 16px; }
.admin-search input { flex: 1; background: var(--bg-input); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 9px 14px; font-family: var(--font); font-size: 14px; color: var(--text-primary); outline: none; }
.admin-search input:focus { border-color: var(--accent); }
.status-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: var(--radius-full); }
.status-badge.banned { background: var(--danger-light); color: var(--danger); }
.status-badge.active { background: var(--success-light); color: var(--success); }
.status-badge.admin { background: var(--warning-light); color: var(--warning); }
.status-badge.pending { background: var(--accent-light); color: var(--accent); }
.status-badge.approved { background: var(--success-light); color: var(--success); }
.status-badge.rejected { background: var(--danger-light); color: var(--danger); }
.status-badge.verified { background: var(--success-light); color: var(--success); }
.status-badge.partner { background: var(--partner-light); color: var(--partner); }
.table-actions { display: flex; gap: 4px; }

/* ============================================================
   MISC UI
   ============================================================ */
.empty-state { text-align: center; padding: 48px 20px; }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.empty-desc { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; }

.welcome-banner { padding: 24px; border-bottom: 1px solid var(--border); }
.welcome-icon { font-size: 48px; margin-bottom: 8px; }
.welcome-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.welcome-desc { color: var(--text-secondary); font-size: 14px; }

/* Toast notifications */
#toast-root { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; font-size: 14px; box-shadow: var(--shadow); animation: toast-in 0.3s cubic-bezier(0.4,0,0.2,1); display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 360px; }
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.info { border-color: var(--accent); }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-msg { flex: 1; }
.toast-dismiss { color: var(--text-muted); cursor: pointer; font-size: 18px; line-height: 1; }
.toast-dismiss:hover { color: var(--text-primary); }
@keyframes toast-in { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100%); } }
.toast.out { animation: toast-out 0.3s ease forwards; }

/* Divider */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 13px; margin: 12px 0; }
.divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Avatar */
.avatar { border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; overflow: hidden; color: white; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: var(--radius-full); font-size: 12px; font-weight: 600; }
.pill-accent { background: var(--accent-light); color: var(--accent); }
.pill-success { background: var(--success-light); color: var(--success); }
.pill-danger { background: var(--danger-light); color: var(--danger); }
.pill-muted { background: var(--bg-elevated); color: var(--text-secondary); }

/* Loading spinner */
.spinner { display: inline-block; width: 20px; height: 20px; border: 2.5px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
.page-loading { display: flex; align-items: center; justify-content: center; height: 200px; }

/* Tooltip */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after { content: attr(data-tooltip); position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%); background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-primary); padding: 5px 10px; border-radius: var(--radius-sm); font-size: 12px; white-space: nowrap; pointer-events: none; z-index: 999; }

/* Color swatches */
.color-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: all var(--transition); }
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: white; box-shadow: 0 0 0 2px var(--accent); }

/* Invite link box */
.invite-box { display: flex; gap: 8px; align-items: center; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
.invite-code { flex: 1; font-family: var(--mono); font-size: 14px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Permission toggles */
.perm-list { display: flex; flex-direction: column; gap: 8px; }
.perm-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--bg-tertiary); border-radius: var(--radius-sm); }
.perm-label { font-size: 14px; font-weight: 500; }
.perm-desc { font-size: 12px; color: var(--text-secondary); }
.toggle { width: 40px; height: 22px; border-radius: var(--radius-full); background: var(--bg-active); cursor: pointer; position: relative; transition: background var(--transition); flex-shrink: 0; }
.toggle.on { background: var(--accent); }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: white; transition: transform var(--transition); }
.toggle.on::after { transform: translateX(18px); }

/* Notification badge */
.notif-badge { background: var(--danger); color: white; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* Mention */
.mention { background: var(--accent-light); color: var(--accent); border-radius: 3px; padding: 0 4px; font-weight: 600; }

/* Channel type icons */
.ch-text::before { content: '#'; }
.ch-announce::before { content: '📢'; font-style: normal; }
.ch-voice::before { content: '🔊'; }

/* Invite page */
.invite-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg-primary); }
.invite-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 40px; max-width: 440px; width: 100%; text-align: center; }
.invite-server-icon { width: 80px; height: 80px; border-radius: 22px; display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 700; color: white; margin: 0 auto 16px; }
.invite-server-name { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.invite-server-desc { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; }
.invite-stats { display: flex; justify-content: center; gap: 24px; margin-bottom: 24px; }
.invite-stat { text-align: center; }
.invite-stat-value { font-size: 20px; font-weight: 700; }
.invite-stat-label { font-size: 12px; color: var(--text-secondary); }

/* Context menu */
.ctx-menu { position: fixed; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; box-shadow: var(--shadow-lg); z-index: 9000; min-width: 180px; animation: fade-in 0.1s ease; }
.ctx-item { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--text-primary); transition: background var(--transition); }
.ctx-item:hover { background: var(--bg-hover); }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover { background: var(--danger-light); }
.ctx-sep { height: 1px; background: var(--border); margin: 3px 0; }

/* Search bar in sidebar */
.sidebar-search { padding: 8px 12px; }
.sidebar-search input { width: 100%; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 12px; font-family: var(--font); font-size: 13px; color: var(--text-primary); outline: none; }
.sidebar-search input::placeholder { color: var(--text-muted); }

/* DM sidebar */
.dm-section { padding: 8px 0; }
.dm-section-header { padding: 8px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); display: flex; align-items: center; justify-content: space-between; }
.dm-item { display: flex; align-items: center; gap: 9px; padding: 6px 12px; cursor: pointer; border-radius: var(--radius-sm); margin: 0 4px; transition: background var(--transition); color: var(--text-secondary); }
.dm-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dm-item.active { background: var(--bg-active); color: var(--text-primary); }

/* Pagination */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 20px; }
.page-btn { width: 32px; height: 32px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 13px; cursor: pointer; color: var(--text-secondary); transition: all var(--transition); }
.page-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.page-btn.active { background: var(--accent); color: white; }

/* Scrollbar global */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-active); }

/* Responsive */
@media (max-width: 768px) {
  .members-sidebar { display: none; }
  .server-rail { width: 56px; }
  .sidebar { width: 200px; }
}
@media (max-width: 480px) {
  .sidebar { display: none; }
  .discovery-content { padding: 16px; }
  .server-grid { grid-template-columns: 1fr; }
}

/* Typing indicator */
.typing-indicator { padding: 4px 16px 8px; font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; min-height: 24px; }
.typing-dots { display: flex; gap: 3px; align-items: center; }
.typing-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--text-secondary); animation: typing-bounce 1.2s infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-4px); } }

/* Role colors */
.role-color-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Settings */
.settings-page { display: flex; height: 100%; }
.settings-nav { width: 220px; padding: 24px 8px; background: var(--bg-secondary); border-right: 1px solid var(--border); }
.settings-nav-section { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); padding: 12px 8px 6px; }
.settings-nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-secondary); font-size: 14px; font-weight: 500; transition: all var(--transition); }
.settings-nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.settings-nav-item.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }
.settings-content { flex: 1; overflow-y: auto; padding: 32px; }
.settings-section { max-width: 600px; }
.settings-section h2 { font-size: 20px; font-weight: 700; margin-bottom: 20px; }

/* ── Notification styles ─────────────────────────────────────────────── */
.notif-item { display:flex; align-items:flex-start; gap:12px; padding:12px 16px; border-radius:var(--radius-sm); border:1px solid var(--border); cursor:pointer; transition:background var(--transition); }
.notif-item.unread { background:var(--accent-light); border-color:var(--accent); }
.notif-item.read { background:var(--bg-secondary); }
.notif-item:hover { background:var(--bg-hover); }
.notif-icon { font-size:20px; flex-shrink:0; }
.notif-body { flex:1; }
.notif-title { font-weight:600; font-size:14px; color:var(--text-primary); }
.notif-desc { font-size:13px; color:var(--text-secondary); margin-top:3px; }
.notif-time { font-size:11px; color:var(--text-muted); margin-top:4px; }
.notif-dot { width:8px; height:8px; border-radius:50%; background:var(--accent); flex-shrink:0; margin-top:4px; }

/* ── GIF styles ──────────────────────────────────────────────────────── */
.gif-item { border-radius:6px; overflow:hidden; cursor:pointer; transition:opacity var(--transition); }
.gif-item:hover { opacity:0.85; }
.msg-gif-wrapper { margin:4px 0; }
.msg-gif { max-width:300px; max-height:250px; border-radius:8px; display:block; }

/* ── Admin stat colours ──────────────────────────────────────────────── */
.admin-stat-value.danger { color:var(--danger); }
.admin-stat-value.warning { color:var(--warning,#F39C12); }

/* ── Message editing ─────────────────────────────────────────────────── */
.message-group.editing { background:rgba(108,99,255,0.06); border-left:3px solid var(--accent); border-radius:var(--radius-sm); padding-left:8px; }
.msg-deleted-text { color:var(--text-muted); font-style:italic; }

/* ── Reply preview styling ───────────────────────────────────────────── */
.reply-preview { display:flex; align-items:center; gap:8px; padding:8px 12px; background:var(--bg-tertiary); border-left:3px solid var(--accent); border-radius:var(--radius-sm) var(--radius-sm) 0 0; font-size:13px; }
.reply-preview-text { flex:1; color:var(--text-secondary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.reply-dismiss { cursor:pointer; font-size:18px; color:var(--text-muted); flex-shrink:0; }
.reply-dismiss:hover { color:var(--text-primary); }

/* ── Status badges ───────────────────────────────────────────────────── */
.status-badge { display:inline-block; padding:2px 8px; border-radius:999px; font-size:11px; font-weight:600; }
.status-badge.active { background:rgba(46,204,113,0.15); color:#2ECC71; }
.status-badge.admin { background:rgba(108,99,255,0.15); color:var(--accent); }
.status-badge.banned { background:rgba(231,76,60,0.15); color:var(--danger); }
.status-badge.partner { background:rgba(52,152,219,0.15); color:#3498DB; }
.status-badge.verified { background:rgba(46,204,113,0.15); color:#2ECC71; }
.status-badge.pending { background:rgba(243,156,18,0.15); color:#F39C12; }
.status-badge.approved { background:rgba(46,204,113,0.15); color:#2ECC71; }
.status-badge.rejected { background:rgba(231,76,60,0.15); color:var(--danger); }

