/* ================================================
   CHAT PLATFORM - DARK PURPLE/BLACK THEME
   ================================================ */

:root {
  --bg-primary:    #06000e;
  --bg-secondary:  #0c0018;
  --bg-card:       #130020;
  --bg-elevated:   #1c002e;
  --bg-input:      #150025;
  --accent:        #8b00ff;
  --accent-hover:  #a040ff;
  --accent-dim:    #3d0070;
  --accent-glow:   rgba(139,0,255,0.25);
  --prime-gold:    #f0c040;
  --plus-blue:     #40b0ff;
  --owner-red:     #ff4444;
  --text-primary:  #f0e6ff;
  --text-secondary:#c0a0e0;
  --text-muted:    #6b4f8f;
  --border:        #22003a;
  --border-accent: #4a007a;
  --online:        #00e676;
  --offline:       #444;
  --danger:        #ff1744;
  --danger-hover:  #ff4569;
  --success:       #00c853;
  --warning:       #ffab00;
  --scrollbar:     #2d004d;
  --scrollbar-hover:#5500aa;
}

/* LIGHT MODE */
.light-mode {
  --bg-primary:    #f0e8ff;
  --bg-secondary:  #e4d4ff;
  --bg-card:       #d8c4ff;
  --bg-elevated:   #cdb0ff;
  --bg-input:      #e8d8ff;
  --accent:        #7000cc;
  --accent-hover:  #5500aa;
  --accent-dim:    #c090ff;
  --accent-glow:   rgba(112,0,204,0.15);
  --text-primary:  #1a0030;
  --text-secondary:#3d0060;
  --text-muted:    #7050a0;
  --border:        #c0a0e0;
  --border-accent: #9060d0;
  --scrollbar:     #c0a0e0;
  --scrollbar-hover:#9060d0;
}

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

html, body {
  height: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
}

/* SCROLLBARS */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }

/* ================================================
   AUTH SCREEN
   ================================================ */

#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(90,0,180,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(139,0,255,0.10) 0%, transparent 50%);
}

.auth-box {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 0 60px rgba(139,0,255,0.2), 0 20px 60px rgba(0,0,0,0.5);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo h1 {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #a040ff, #ff40ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.auth-logo p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.auth-tabs {
  display: flex;
  border-radius: 8px;
  background: var(--bg-secondary);
  padding: 3px;
  margin-bottom: 24px;
}

.auth-tab-btn {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.auth-tab-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 20px var(--accent-glow);
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

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

.btn {
  padding: 11px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 30px rgba(160,64,255,0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border-accent);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: var(--danger-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 8px; font-size: 11px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.auth-error {
  background: rgba(255,23,68,0.15);
  border: 1px solid rgba(255,23,68,0.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #ff6b6b;
  display: none;
}

.auth-error.show { display: block; }

/* ================================================
   APP LAYOUT
   ================================================ */

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

/* HEADER */
.app-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  height: 58px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 100;
}

.app-logo {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, #a040ff, #ff40ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  margin-right: 8px;
}

.nav-tabs {
  display: flex;
  gap: 2px;
  flex: 1;
}

.nav-tab {
  padding: 7px 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  letter-spacing: 0.3px;
  position: relative;
}

.nav-tab:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.nav-tab.active {
  background: var(--accent-dim);
  color: var(--accent-hover);
}

.nav-tab.admin-tab { color: var(--owner-red); }
.nav-tab.admin-tab:hover { background: rgba(255,68,68,0.15); color: #ff6666; }
.nav-tab.admin-tab.active { background: rgba(255,68,68,0.2); color: var(--owner-red); }

.unread-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.2); }
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid var(--accent);
  object-fit: cover;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-weight: 700;
  overflow: hidden;
}

.header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.role-badge {
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-owner { background: rgba(255,68,68,0.25); color: var(--owner-red); border: 1px solid rgba(255,68,68,0.4); }
.badge-prime { background: rgba(240,192,64,0.2); color: var(--prime-gold); border: 1px solid rgba(240,192,64,0.4); }
.badge-plus  { background: rgba(64,176,255,0.2); color: var(--plus-blue); border: 1px solid rgba(64,176,255,0.4); }
.badge-basic { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); }

/* APP BODY */
.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ================================================
   TAB CONTENT
   ================================================ */

.tab-content {
  display: none;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.tab-content.active { display: flex; }

/* ================================================
   DMs TAB
   ================================================ */

.dm-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-header h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.search-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.search-input:focus {
  border-color: var(--accent);
}

.search-input::placeholder { color: var(--text-muted); }

.sidebar-section {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 8px 8px 4px;
}

.dm-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.dm-contact:hover { background: var(--bg-elevated); }
.dm-contact.active { background: var(--accent-dim); }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--online);
  border: 2px solid var(--bg-secondary);
}

.online-dot.offline { background: var(--offline); }

.contact-info { flex: 1; min-width: 0; }
.contact-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-preview {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unread-count {
  background: var(--accent);
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state svg { opacity: 0.4; }
.empty-state p { font-size: 13px; }

/* DM CHAT AREA */
.dm-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 14px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.chat-header-info { flex: 1; }
.chat-header-info h3 { font-size: 14px; font-weight: 700; }
.chat-header-info p { font-size: 12px; color: var(--text-muted); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message {
  display: flex;
  gap: 12px;
  padding: 4px 0;
  max-width: 100%;
}

.message:hover { background: rgba(255,255,255,0.02); border-radius: 8px; padding: 4px 8px; margin: 0 -8px; }

.message-avatar { flex-shrink: 0; margin-top: 2px; }

.message-body { flex: 1; min-width: 0; }

.message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.message-author {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.message-time {
  font-size: 11px;
  color: var(--text-muted);
}

.message-content {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

.message-group .message:not(:first-child) .message-avatar { visibility: hidden; }
.message-group .message:not(:first-child) .message-header { display: none; }

.my-message .message-author { color: var(--accent-hover); }

.chat-input-area {
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-input-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  transition: border-color 0.2s;
}

.chat-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  resize: none;
  max-height: 120px;
  line-height: 1.5;
  font-family: inherit;
}

.chat-input::placeholder { color: var(--text-muted); }

.send-btn {
  background: var(--accent);
  border: none;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.send-btn:hover { background: var(--accent-hover); transform: scale(1.05); }
.send-btn svg { fill: white; }

.no-chat-selected {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: 1;
  color: var(--text-muted);
}

.no-chat-selected h3 { font-size: 18px; color: var(--text-secondary); }
.no-chat-selected p { font-size: 14px; }

/* ================================================
   PUBLIC CHAT TAB
   ================================================ */

#tab-public {
  flex-direction: column;
}

.public-chat-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

.public-header {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.public-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.public-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ================================================
   USERS TAB
   ================================================ */

#tab-users {
  flex-direction: column;
  overflow-y: auto;
}

.users-container {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px;
}

.users-container h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.users-container .sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 20px;
}

.users-search-bar {
  margin-bottom: 20px;
}

.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.user-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s, transform 0.15s;
}

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

.user-card-info { flex: 1; min-width: 0; }

.user-card-name {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-card-status {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.user-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ================================================
   SETTINGS TAB
   ================================================ */

#tab-settings {
  flex-direction: column;
  overflow-y: auto;
}

.settings-container {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 20px;
}

.settings-container h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.settings-container .sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 32px;
}

.settings-section {
  margin-bottom: 28px;
}

.settings-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.setting-row:last-child { border-bottom: none; }

.setting-info h4 { font-size: 14px; font-weight: 600; }
.setting-info p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Toggle */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid var(--border);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}

.toggle input:checked + .toggle-slider {
  background: var(--accent-dim);
  border-color: var(--accent);
}

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

/* Avatar Upload */
.avatar-upload-area {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 0;
}

.avatar-large {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 3px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar-large img { width: 100%; height: 100%; object-fit: cover; }

.prime-lock {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(240,192,64,0.1);
  border: 1px solid rgba(240,192,64,0.3);
  border-radius: 8px;
  font-size: 12px;
  color: var(--prime-gold);
}

/* ================================================
   ADMIN TAB
   ================================================ */

#tab-admin {
  flex-direction: column;
  overflow-y: auto;
}

.admin-container {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 20px;
}

.admin-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.admin-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--owner-red);
}

.admin-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.admin-section h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-row input {
  flex: 1;
}

.admin-user-list { display: flex; flex-direction: column; gap: 8px; }

.admin-user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.admin-user-item .info { flex: 1; }
.admin-user-item .name { font-size: 13px; font-weight: 600; }
.admin-user-item .email { font-size: 12px; color: var(--text-muted); }
.admin-actions { display: flex; gap: 6px; }

select.role-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

/* ================================================
   FRIEND REQUEST NOTIFICATION
   ================================================ */

.friend-requests-section { margin-top: 16px; }

.friend-req-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-elevated);
  border-radius: 8px;
  border: 1px solid var(--border-accent);
  margin-bottom: 6px;
}

.friend-req-item .info { flex: 1; font-size: 13px; }
.friend-req-actions { display: flex; gap: 6px; }

/* ================================================
   MODAL
   ================================================ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-overlay.show { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(139,0,255,0.2);
}

.modal h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ================================================
   TOAST NOTIFICATIONS
   ================================================ */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  max-width: 300px;
}

.toast.success { border-color: rgba(0,200,83,0.5); }
.toast.error { border-color: rgba(255,23,68,0.5); }
.toast.info { border-color: var(--border-accent); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(10px); }
}

/* ================================================
   LOADING / SPINNER
   ================================================ */

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-messages {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
  gap: 10px;
}

/* ================================================
   MISC UTILITIES
   ================================================ */

.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-hover); }
.text-prime { color: var(--prime-gold); }
.text-plus { color: var(--plus-blue); }
.text-owner { color: var(--owner-red); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.flex { display: flex; }
.gap-8 { gap: 8px; }
.items-center { align-items: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }

.access-denied {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
}

.access-denied h3 { font-size: 20px; color: var(--text-secondary); }
.access-denied p { font-size: 14px; max-width: 300px; }

/* NEW DM BUTTON */
.new-dm-btn {
  width: 100%;
  margin-top: 8px;
  background: var(--accent-dim);
  color: var(--accent-hover);
  border: 1px dashed var(--border-accent);
}

.new-dm-btn:hover { background: var(--accent); color: white; border-style: solid; }

/* Banned overlay */
.banned-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 100vh;
  color: var(--danger);
  text-align: center;
}

.banned-overlay h2 { font-size: 28px; }
.banned-overlay p { color: var(--text-muted); font-size: 14px; }

/* Responsive tweaks */
@media (max-width: 600px) {
  .app-logo { display: none; }
  .nav-tab { padding: 7px 10px; font-size: 12px; }
  .dm-sidebar { width: 200px; }
  .users-grid { grid-template-columns: 1fr; }
}
