/* Core layout */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', 'Twemoji Mozilla', -apple-system, BlinkMacSystemFont, 'Segoe UI', 
               'Segoe UI Emoji', 'Noto Color Emoji', 'Apple Color Emoji', Roboto, sans-serif;
  background: #181818;
  color: #e4e4e4;
  min-height: 100vh;
  overflow: hidden;
}
.app-container { display: grid; grid-template-columns: 280px 1fr; height: 100vh; gap: 0; min-height: 0; }

/* Sidebar */
.sidebar { background: #202020; border-right: 1px solid #2a2a2a; display: flex; flex-direction: column; min-height: 0; }
.sidebar-header { padding: 20px; border-bottom: 1px solid #2a2a2a; }
.logo { font-size: 24px; font-weight: 700; color: #6366f1; margin-bottom: 8px; }
.logo-main { color: #ffffff; }
.logo-suffix { color: #6D5DDE; margin-left: 4px; font-weight: 700; }
.user-info { display: flex; align-items: center; gap: 12px; padding: 12px; background: #262626; border-radius: 8px; cursor: pointer; transition: all 0.2s ease; }
.user-info:hover { background: #2c2c2c; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; background: #6D5DDE; display: flex; align-items: center; justify-content: center; color: white; font-weight: 600; font-size: 16px; overflow: hidden; position: relative; }
.user-details { flex: 1; }
.username { font-weight: 600; color: #e4e4e4; font-size: 14px; }
.user-status { font-size: 12px; color: #a1a1a1; }

.servers-section { flex: 1; padding: 20px; overflow-y: auto; min-height: 0; }
.sidebar-switcher { display: flex; gap: 8px; background: #262626; padding: 4px; border-radius: 8px; margin-bottom: 16px; }
.sidebar-switch { flex: 1; border: none; background: transparent; color: #a1a1a1; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; padding: 8px 0; border-radius: 6px; cursor: pointer; transition: all 0.2s ease; }
.sidebar-switch:hover { color: #e4e4e4; }
.sidebar-switch.active { background: #2f2f2f; color: #f8fafc; }
.sidebar-panel { display: block; }
.section-title { font-size: 13px; font-weight: 600; color: #a1a1a1; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.section-left { display: flex; align-items: center; gap: 8px; }
.add-btn { width: 20px; height: 20px; border-radius: 4px; background: #2c2c2c; color: #e4e4e4; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; transition: background 0.2s ease; }
.add-btn:hover { background: #353535; }
.sidebar-back { width: 24px; height: 24px; border-radius: 4px; background: #2c2c2c; color: #e4e4e4; border: none; cursor: pointer; }
.sidebar-back:hover { background: #353535; }

/* Cards & lists */
.server-card, .channel-item { background: #262626; border-radius: 8px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; transition: all 0.2s ease; border: 2px solid transparent; display: flex; align-items: center; justify-content: space-between; }
.server-card:hover, .channel-item:hover { background: #2c2c2c; }
.server-card.active, .channel-item.active { border-color: #4a4a4a; background: rgba(74, 74, 74, 0.1); }
.server-name, .channel-name { font-weight: 600; color: #e4e4e4; }
.server-info { font-size: 12px; color: #a1a1a1; display: flex; gap: 8px; align-items: center; }
.server-actions { display: flex; gap: 8px; }
.btn-small { 
  padding: 8px 14px; 
  border-radius: 6px; 
  border: 1px solid #3a3a3a; 
  font-size: 12px; 
  font-weight: 500;
  cursor: pointer; 
  transition: all 0.2s ease;
  background: #2a2a2a;
  color: #e4e4e4;
  box-shadow: none;
}
.btn-small:hover { 
  background: #3a3a3a; 
  border-color: #4a4a4a;
  transform: none;
  box-shadow: none;
}
.invite-row .btn-small {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(99, 102, 241, 0.4);
  color: #e2e8f0;
}
.invite-row .btn-small:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(129, 140, 248, 0.8);
}
#memberOwnerTag {
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(226, 232, 240, 0.75);
}
.overview-card.primary #copyOverviewInvite {
  min-width: 90px;
}
.btn-invite { background: #10b981; border-color: #059669; color: white; }
.btn-invite:hover { background: #059669; }
.btn-join { background: #3a3a3a; border-color: #4a4a4a; color: white; }
.btn-join:hover { background: #4a4a4a; border-color: #5a5a5a; }
.btn-small.btn-secondary { background: #2c2c2c; border-color: #3a3a3a; color: #e4e4e4; }
.btn-small.btn-secondary:hover { background: #353535; border-color: #4a4a4a; }
.btn-small.btn-success { background: #15803d; border-color: #166534; color: #ecfdf5; }
.btn-small.btn-success:hover { background: #166534; border-color: #14532d; }
.btn-small.btn-danger { background: #b91c1c; border-color: #991b1b; color: #fef2f2; }
.btn-small.btn-danger:hover { background: #991b1b; border-color: #7f1d1d; }

#directPanel .direct-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 8px; }
.direct-tabs { display: flex; gap: 8px; background: #262626; padding: 4px; border-radius: 8px; }
.direct-tab { border: none; background: transparent; color: #a1a1a1; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; padding: 8px 12px; border-radius: 6px; cursor: pointer; transition: all 0.2s ease; }
.direct-tab:hover { color: #e4e4e4; }
.direct-tab.active { background: #2f2f2f; color: #f8fafc; }
.direct-actions { display: flex; align-items: center; gap: 8px; }
.direct-section { display: block; }
/* Input actions */
.message-input-area .input-actions .attach-btn,
.message-input-area .input-actions .emoji-btn,
.message-input-area .input-actions .gif-btn,
.message-input-area .input-actions .send-btn { margin-left: 6px; }
.message-input-area .input-actions .attach-btn { background: #2c2c2c; color: #e4e4e4; border: 1px solid #3a3a3a; border-radius: 6px; padding: 6px 10px; cursor: pointer; }
.message-input-area .input-actions .attach-btn:hover { background: #353535; }
.friends-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.friends-summary { font-size: 12px; color: #a1a1a1; text-transform: uppercase; letter-spacing: 0.4px; }
.friends-list, .friends-requests-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.friends-empty { background: #262626; border-radius: 8px; padding: 16px; color: #a1a1a1; font-size: 13px; display: flex; flex-direction: column; gap: 6px; border: 1px dashed #343434; }
.friends-empty strong { color: #e4e4e4; }
.friends-empty.muted { opacity: 0.7; border-style: solid; }
.friends-heading { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: #a1a1a1; margin-bottom: 8px; }
.friend-card { cursor: default; justify-content: flex-start; gap: 12px; flex-wrap: wrap; align-items: center; }
.friend-card .direct-left { flex: 1 1 150px; min-width: 0; }
.friend-card.pending { border-style: dashed; }
.friend-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.friend-action { flex-shrink: 0; }

/* Profile Modal */
.profile-modal { 
  width: 100vw; 
  height: 100vh; 
  max-width: 100vw;
  max-height: 100vh;
  padding: 0; 
  border: none;
  border-radius: 0;

.profile-tag-label {
  font-weight: 600;
  letter-spacing: 0.2px;
}
  background: #181818; 
  display: flex; 
  flex-direction: column; 
  overflow: hidden; 
}
.profile-shell { flex: 1; display: flex; flex-direction: column; overflow-y: auto; }

/* Profile hero */
.profile-hero {
  position: relative;
  padding: clamp(110px, 18vh, 200px) 36px 40px;
  background: #202020;
  border-bottom: 1px solid #2a2a2a;
}

.profile-hero-content {
  display: flex;
  flex-direction: column;

.profile-tag.moderator {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(37, 99, 235, 0.1));
  border-color: rgba(59, 130, 246, 0.4);
  color: #dbeafe;
}

.profile-tag.support {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(34, 197, 94, 0.12));
  border-color: rgba(14, 165, 233, 0.35);
  color: #bae6fd;
}

.profile-tag.custom {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.14), rgba(148, 163, 184, 0.08));
  border-color: rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
}
  gap: 24px;
}

.profile-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 220px;
  background: linear-gradient(135deg, #2a2a2a 0%, #202020 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  border-bottom: 1px solid rgba(42, 42, 42, 0.8);
  box-shadow: inset 0 -40px 60px rgba(16, 16, 16, 0.65);
}
.profile-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16, 16, 16, 0.1) 10%, rgba(16, 16, 16, 0.55) 90%);
  pointer-events: none;
}
.profile-banner.has-image::before {
  background: linear-gradient(180deg, rgba(16, 16, 16, 0.25) 0%, rgba(16, 16, 16, 0.7) 100%);
}
.profile-banner.has-color {
  background: var(--banner-color, linear-gradient(135deg, #2a2a2a 0%, #202020 100%));
}

.profile-hero > :not(.profile-banner) { position: relative; z-index: 2; }
.profile-hero-main {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  min-width: 0;
  flex-wrap: wrap;
}
.profile-hero-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: stretch;
  align-content: flex-start;
  justify-content: flex-start;
}
.profile-hero-meta-card {
  background: #1b1b1b;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  padding: 18px 20px;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.profile-avatar-wrapper { 
  width: 112px; 
  height: 112px; 
  border-radius: 50%;
  background: #2a2a2a;
  border: 2px solid #3a3a3a;
  display: flex; 
  align-items: center; 
  justify-content: center; 
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  overflow: hidden; 
  margin-top: -64px;
}
.profile-avatar { 
  width: 100px; 
  height: 100px; 
  border-radius: 50%;
  background: #6D5DDE;
  color: #f8fafc; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 42px; 
  font-weight: 700; 
  text-transform: uppercase; 
  position: relative; 
  overflow: hidden; 
}
.profile-hero-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.profile-display-name { font-size: 30px; font-weight: 700; letter-spacing: -0.6px; color: #ffffff; margin: 0; }
.profile-username { font-size: 16px; font-weight: 600; color: #a1a1a1; margin: 0; overflow-wrap: anywhere; }
.profile-status { font-size: 15px; color: #848484; margin: 0; font-style: italic; opacity: 0.9; }
.profile-status-empty { opacity: 0.6; color: #6b7280; }
.profile-meta-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: #a1a1a1; }
.profile-meta-value { font-size: 16px; font-weight: 600; color: #e4e4e4; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-start; }

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.profile-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(109, 93, 222, 0.15), rgba(139, 125, 232, 0.1));
  border: 1px solid rgba(109, 93, 222, 0.3);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #a5b4fc;
  letter-spacing: 0.3px;
}

.profile-tag-icon {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.profile-tag.verified {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(22, 163, 74, 0.1));
  border-color: rgba(34, 197, 94, 0.3);
  color: #86efac;
}

.profile-tag.staff {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.1));
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.profile-tag.premium {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.1));
  border-color: rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

/* Typing indicator - minimal inline style */
#typingIndicator.typing-indicator {
  margin: 6px 8px 10px;
  padding: 0;
  font-size: 12px;
  color: #9aa4b2;
  background: transparent;
  border: none;
  border-radius: 0;
  width: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: none;
}

.typing-indicator .typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.typing-indicator .typing-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #9aa4b2;
  opacity: 0.5;
  animation: typingBounce 1s infinite ease-in-out;
}

.typing-indicator .typing-dot:nth-child(2) { animation-delay: 0.12s; }
.typing-indicator .typing-dot:nth-child(3) { animation-delay: 0.24s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-2px); opacity: 0.9; }
}

.typing-indicator .typing-text {
  color: #aeb8c5;
}

/* Attachments */
.message-input-area { display: flex; flex-direction: column; gap: 8px; }
.attachment-preview { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 4px; padding: 10px; border: 1px solid #343434; border-radius: 10px; background: #1d1d1d; }
.attachment-chip { display: inline-flex; align-items: center; gap: 8px; background: #232323; border: 1px solid #343434; border-radius: 10px; padding: 6px 10px; font-size: 12px; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.attachment-chip.loading { opacity: 0.7; }
.attachment-chip-thumb { width: 28px; height: 28px; object-fit: cover; border-radius: 6px; border: 1px solid #3a3a3a; background: #111; }
.attachment-chip-icon { font-size: 16px; }
.attachment-chip-label { color: #e4e4e4; }
.attachment-chip-remove { background: transparent; border: none; color: #9aa4b2; cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.attachment-chip-remove:hover { color: #e879f9; }

.message-attachments { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.message-attachments .att-image img { max-width: 420px; height: auto; border-radius: 8px; display: block; }
.message-attachments .att-video video { max-width: 420px; border-radius: 8px; display: block; background: #000; }
.message-attachments .att-file a { color: #93c5fd; text-decoration: none; }
.message-attachments .att-file a:hover { text-decoration: underline; }

/* Profile view */
#profileView.profile-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 36px 40px 40px;
  background: #181818;
}
.profile-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.profile-side {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.profile-card { 
  background: #202020;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 24px; 
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  display: flex; 
  flex-direction: column; 
  gap: 16px; 
}
.profile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.profile-card-header > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profile-card-header h3 { 
  margin: 0; 
  font-size: 14px; 
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: #e4e4e4;
}
.profile-card-subtitle {
  margin: 0;
  font-size: 13px;
  color: #848484;
  line-height: 1.6;
}
.profile-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.45);
  font-size: 13px;
  font-weight: 600;
  color: #c7d2fe;
  white-space: normal;
  text-align: left;
  max-width: 320px;
}
.profile-status-pill.profile-status-pill-empty {
  background: rgba(132, 132, 132, 0.1);
  border-color: rgba(132, 132, 132, 0.3);
  color: #9ca3af;
}
.profile-bio { margin: 0; font-size: 15px; line-height: 1.7; color: #e4e4e4; white-space: pre-wrap; }
.profile-bio-empty { color: #848484; font-style: italic; }
.profile-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.profile-summary-item {
  background: #1b1b1b;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Message edited label and inline edit controls */
.message-edited {
  font-size: 12px;
  color: #9ca3af;
  margin-left: 6px;
  font-weight: 600;
}

.message-edit-wrapper { display: flex; flex-direction: column; gap: 8px; }
.message-edit-textarea { width: 100%; background: #121212; border: 1px solid #2a2a2a; color: #e4e4e4; padding: 8px; border-radius: 8px; resize: vertical; min-height: 48px; }
.message-edit-actions { display:flex; gap:8px; justify-content:flex-end; }
.message-edit-actions .btn-small { padding:6px 10px; font-size:13px; }
.message-edit-actions .btn-secondary { background:#2c2c2c; border-color:#3a3a3a }
.profile-summary-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #a1a1a1;
  font-weight: 600;
}
.profile-summary-value {
  font-size: 15px;
  font-weight: 600;
  color: #e4e4e4;
  overflow-wrap: anywhere;
}
.profile-detail-grid { display: grid; gap: 16px; }
.profile-detail { 
  background: #1b1b1b;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 16px 18px; 
  display: flex; 
  flex-direction: column; 
  gap: 6px; 
  transition: border-color 0.2s ease, transform 0.2s ease; 
}
.profile-detail:hover { 
  border-color: #3a3a3a;
  transform: translateY(-2px); 
}
.profile-detail-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.7px; color: #a1a1a1; font-weight: 600; }
.profile-detail-value { font-size: 15px; font-weight: 500; color: #e4e4e4; word-break: break-word; }
.profile-detail-link { color: #6D5DDE; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.profile-detail-link:hover { color: #8b7de8; text-decoration: underline; }
.profile-highlight-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.profile-highlight-item {
  background: #1b1b1b;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profile-highlight-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #a1a1a1;
  font-weight: 600;
}
.profile-highlight-value {
  font-size: 15px;
  font-weight: 600;
  color: #e4e4e4;
}
.profile-highlight-value.muted {
  color: #8b8b8b;
  font-weight: 500;
}
.profile-links-empty {
  padding: 16px 18px;
  border: 1px dashed #343434;
  border-radius: 10px;
  color: #a1a1a1;
  font-size: 13px;
  text-align: center;
}
.profile-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.profile-activity-empty {
  padding: 18px;
  border-radius: 10px;
  border: 1px dashed #343434;
  background: rgba(26, 26, 26, 0.8);
  color: #8b8b8b;
  font-size: 13px;
  text-align: center;
}

/* Profile edit */
.profile-edit-form { 
  background: transparent; 
  border: none; 
  padding: 0; 
  margin: 0; 
}

.profile-edit-shell { 
  display: flex; 
  flex-direction: column; 
  gap: 32px; 
  padding: 32px 40px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.profile-edit-hero { 
  background: linear-gradient(135deg, #262626 0%, #202020 100%);
  border: 1px solid #3a3a3a;
  border-radius: 16px; 
  padding: 32px; 
  color: #e4e4e4;
  position: relative;
  overflow: hidden;
}
.profile-edit-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #6D5DDE, #8b7de8, #6D5DDE);
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.profile-edit-hero h3 { 
  margin: 0; 
  font-size: 28px; 
  font-weight: 700; 
  letter-spacing: -0.5px; 
  color: #ffffff;
  background: linear-gradient(135deg, #ffffff, #e4e4e4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.profile-edit-subtitle { 
  margin: 10px 0 0; 
  font-size: 14px; 
  color: #a1a1a1; 
  line-height: 1.6; 
  max-width: 600px;
}

.profile-edit-columns { 
  display: grid; 
  grid-template-columns: 1fr; 
  gap: 24px; 
  align-items: flex-start; 
}

.profile-edit-card { 
  background: #202020;
  border: 1px solid #2a2a2a;
  border-radius: 16px; 
  padding: 32px; 
  display: flex; 
  flex-direction: column; 
  gap: 28px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.profile-edit-card:hover {
  border-color: #3a3a3a;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.profile-section-group { 
  display: flex; 
  flex-direction: column; 
  gap: 20px; 
}

.profile-section-heading { 
  display: flex; 
  flex-direction: column; 
  gap: 6px;
  padding-bottom: 16px;
  border-bottom: 2px solid #2a2a2a;
  position: relative;
}
.profile-section-heading::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: #6D5DDE;
}

.profile-section-heading h4 { 
  margin: 0; 
  font-size: 16px; 
  font-weight: 700; 
  color: #ffffff;
  text-transform: none;
  letter-spacing: -0.2px;
}

.profile-section-heading p { 
  margin: 0; 
  font-size: 13px; 
  color: #a1a1a1; 
  line-height: 1.5; 
}

.profile-field-grid { 
  display: grid; 
  grid-template-columns: 1fr; 
  gap: 20px; 
}
.profile-field-grid.compact { 
  grid-template-columns: 1fr; 
}
.profile-field.profile-field-wide { 
  grid-column: 1 / -1; 
}

.profile-field { 
  margin: 0; 
  display: flex; 
  flex-direction: column; 
  gap: 10px; 
}

.profile-field .form-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #e4e4e4;
}

.profile-field .form-input {
  background: #1b1b1b;
  border: 2px solid #2a2a2a;
  border-radius: 10px;
  padding: 14px 16px;
  color: #e4e4e4;
  font-size: 14px;
  transition: all 0.2s ease;
}
.profile-field .form-input:focus {
  border-color: #6D5DDE;
  background: #1b1b1b;
  box-shadow: 0 0 0 3px rgba(109, 93, 222, 0.15);
  outline: none;
}
.profile-field .form-input:hover:not(:focus) {
  border-color: #3a3a3a;
}

.profile-bio-input { 
  min-height: 140px; 
  resize: vertical; 
  font-size: 14px; 
  line-height: 1.6;
  font-family: inherit;
}

.profile-edit-side { 
  display: flex; 
  flex-direction: column; 
  gap: 24px; 
}

.profile-banner-preview {
  width: 100%;
  height: 160px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2a2a2a, #262626);
  border: 2px dashed #3a3a3a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #848484;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  background-size: cover;
  background-position: center;
}
.profile-banner-preview:hover {
  border-color: #6D5DDE;
}
.profile-banner-preview.has-image {
  color: transparent;
  border-style: solid;
}

.profile-avatar-stack { 
  display: flex; 
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.profile-avatar-preview { 
  width: 140px; 
  height: 140px; 
  border-radius: 50%;
  background: linear-gradient(135deg, #2a2a2a, #262626);
  border: 3px solid #3a3a3a;
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 48px; 
  font-weight: 700; 
  color: #ffffff;
  position: relative; 
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.profile-avatar-preview:hover {
  border-color: #6D5DDE;
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(109, 93, 222, 0.3);
}

.profile-avatar-controls { 
  display: flex; 
  flex-direction: column; 
  gap: 12px; 
  width: 100%;
}

.profile-file-input { 
  display: none; 
}

.profile-avatar-controls .btn { 
  width: 100%; 
  font-size: 13px; 
  font-weight: 600;
  padding: 12px 20px;
  background: #2a2a2a;
  border: 2px solid #3a3a3a;
  border-radius: 10px;
  transition: all 0.2s ease;
}
.profile-avatar-controls .btn:hover {
  background: #3a3a3a;
  border-color: #4a4a4a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.profile-avatar-controls .btn:active {
  transform: translateY(0);
}
.profile-avatar-controls .btn + .btn { 
  margin-top: 0; 
}

.profile-avatar-controls .form-label { 
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #e4e4e4;
}

.profile-avatar-controls .color-input { 
  padding: 6px; 
  height: 50px; 
  border-radius: 10px;
  cursor: pointer;
  background: #1b1b1b;
  border: 2px solid #2a2a2a;
  transition: all 0.2s ease;
}
.profile-avatar-controls .color-input:hover {
  border-color: #3a3a3a;
}
.profile-avatar-controls .color-input:focus {
  border-color: #6D5DDE;
  outline: none;
  box-shadow: 0 0 0 3px rgba(109, 93, 222, 0.15);
}

.profile-upload-hint { 
  margin: 8px 0 0; 
  font-size: 11px; 
  color: #848484; 
  line-height: 1.5;
  text-align: center;
}

.profile-upload-file { 
  margin: 4px 0 0; 
  font-size: 11px; 
  color: #a1a1a1; 
  word-break: break-word;
  text-align: center;
  font-weight: 500;
}

.profile-edit-actions { 
  display: flex; 
  justify-content: flex-end; 
  gap: 12px; 
  padding-top: 20px;
  border-top: 2px solid #2a2a2a;
  margin-top: 12px;
}

.profile-edit-actions .btn { 
  min-width: 140px; 
  font-size: 15px; 
  padding: 14px 28px; 
  font-weight: 600;
  width: auto;
  border-radius: 10px;
  transition: all 0.2s ease;
}
.profile-edit-actions .btn:not(.btn-secondary) {
  background: linear-gradient(135deg, #6D5DDE, #8b7de8);
  border: none;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(109, 93, 222, 0.3);
}
.profile-edit-actions .btn:not(.btn-secondary):hover {
  background: linear-gradient(135deg, #5d4dce, #7b6dd8);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(109, 93, 222, 0.4);
}
.profile-edit-actions .btn-secondary {
  background: #2a2a2a;
  border: 2px solid #3a3a3a;
  color: #e4e4e4;
}
.profile-edit-actions .btn-secondary:hover {
  background: #3a3a3a;
  border-color: #4a4a4a;
}

.profile-avatar.has-image,
.user-avatar.has-image,
.profile-avatar-preview.has-image { background-size: cover; background-position: center; background-repeat: no-repeat; color: transparent; }

@media (min-width: 720px) {
  .profile-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-field-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-edit-actions {
    flex-direction: row;
  }
}

@media (max-width: 900px) {
  #profileView.profile-layout {
    padding: 32px 24px 36px;
  }
  .profile-hero-content {
    align-items: center;
    text-align: center;
  }
  .profile-hero-main {
    justify-content: center;
  }
  .profile-hero-text {
    align-items: center;
  }
  .profile-tags {
    justify-content: center;
  }
  .profile-hero-secondary {
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  .profile-hero-meta-card {
    width: 100%;
    text-align: center;
  }
  .profile-hero-secondary .profile-actions {
    width: 100%;
    justify-content: center;
  }
  .profile-hero-secondary .profile-actions .btn {
    width: 100%;
    max-width: 260px;
  }
}

@media (max-width: 640px) {
  .profile-hero {
    padding: clamp(95px, 21vh, 150px) 24px 28px;
  }
  .profile-avatar-wrapper {
    width: 96px;
    height: 96px;
    margin-top: -56px;
  }
  .profile-avatar {
    width: 84px;
    height: 84px;
    font-size: 36px;
  }
  #profileView.profile-layout {
    padding: 28px 20px 32px;
  }
  .profile-status-pill {
    width: 100%;
  }
  .profile-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    text-align: left;
  }
  .profile-card-header > div {
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .profile-hero {
    padding: clamp(85px, 24vh, 130px) 16px 24px;
@media (max-height: 720px) {
  .profile-hero {
    padding-top: clamp(90px, 18vh, 140px);
  }
  .profile-avatar-wrapper {
    margin-top: -52px;
  }
}

@media (max-height: 600px) {
  .profile-hero {
    padding-top: clamp(70px, 20vh, 120px);
  }
  .profile-avatar-wrapper {
    margin-top: -40px;
  }
  .profile-hero-secondary .profile-actions .btn {
    max-width: 220px;
  }
}

@media (max-height: 520px) {
  .profile-hero {
    padding-top: clamp(60px, 18vh, 110px);
  }
  .profile-hero-content {
    gap: 18px;
  }
  .profile-hero-secondary {
    gap: 10px;
  }
}
  }
  .profile-avatar-wrapper {
    margin-top: -48px;
  }
  #profileView.profile-layout {
    padding: 24px 16px 28px;
  }
  .profile-card {
    padding: 20px;
  }
  .profile-summary-grid {
    gap: 12px;
  }
  .profile-summary-item {
    padding: 12px 14px;
  }
  .profile-highlight-item {
    padding: 14px 16px;
  }
  .profile-status-pill {
    text-align: center;
  }
}

@media (min-width: 900px) {
  .profile-hero-content {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
  .profile-hero-secondary {
    justify-content: flex-end;
  }
  .profile-hero-secondary .profile-actions {
    justify-content: flex-end;
  }
  #profileView.profile-layout {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    align-items: start;
  }
}

@media (min-width: 1024px) {
  .profile-edit-columns { grid-template-columns: 1fr 360px; }
  .profile-avatar-stack { align-items: stretch; }
  .profile-edit-shell {
    padding: 40px 48px 48px;
  }
}

.profile-edit-form .btn { width: auto; }
.profile-link { 
  border: none; 
  background: transparent; 
  color: #6D5DDE;
  font-weight: 600; 
  cursor: pointer; 
  padding: 0; 
  font-size: inherit; 
  text-decoration: none; 
}
.profile-link:hover { 
  color: #8b7de8;
  text-decoration: underline; 
}

.channel-list { display: flex; flex-direction: column; }
.channel-item .left { display: flex; align-items: center; gap: 8px; }
.channel-hash { width: 22px; height: 22px; background: #6D5DDE; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: white; font-size: 12px; }

#directList { display: flex; flex-direction: column; gap: 8px; }
.direct-card { align-items: center; gap: 12px; }
.direct-card .direct-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.direct-avatar { width: 34px; height: 34px; border-radius: 50%; background: #3b3b3b; display: flex; align-items: center; justify-content: center; color: #f8fafc; font-weight: 600; font-size: 14px; flex-shrink: 0; overflow: hidden; position: relative; background-size: cover; background-position: center; background-repeat: no-repeat; transition: transform 0.2s ease; }
.direct-avatar.has-image { color: transparent; }
.direct-meta { display: flex; flex-direction: column; gap: 2px; }
.direct-name { font-weight: 600; color: #e4e4e4; font-size: 14px; }
.direct-meta { min-width: 0; }
.direct-preview { font-size: 12px; color: #848484; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: inherit; }
.direct-preview .twemoji-emoji { width: 1.05em; height: 1.05em; vertical-align: -0.15em; margin: 0 0.04em; }
.direct-right { margin-left: auto; padding-left: 12px; text-align: right; font-size: 11px; color: #6b7280; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; flex-shrink: 0; }
.direct-active { border-color: #4a4a4a; background: rgba(74, 74, 74, 0.1); }

/* Main Content */
.main-content { display: flex; flex-direction: column; background: #1b1b1b; border-radius: 0; margin: 0; overflow: hidden; min-height: 0; }
.content-header { background: #202020; padding: 20px 24px; border-bottom: 1px solid #2a2a2a; display: flex; align-items: center; justify-content: space-between; }
.content-info { display: flex; align-items: center; gap: 12px; }
.content-icon { width: 36px; height: 36px; background: #6D5DDE; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; font-size: 18px; font-weight: 600; overflow: hidden; position: relative; background-size: cover; background-position: center; background-repeat: no-repeat; }
.content-icon.has-image { color: transparent; }
.content-details h3 { font-size: 18px; color: #e4e4e4; margin-bottom: 2px; }
.content-details p { font-size: 12px; color: #a1a1a1; }
.content-actions { display: flex; gap: 8px; }

/* Empty State */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; padding: 40px; text-align: center; }
.empty-icon { width: 80px; height: 80px; background: #6D5DDE; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; font-size: 32px; color: #ffffff; }
.empty-title { font-size: 24px; font-weight: 600; color: #e4e4e4; margin-bottom: 8px; }
.empty-subtitle { color: #a1a1a1; margin-bottom: 24px; max-width: 300px; }

/* Chat */
#chatInterface { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.messages-container { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.loading-older-messages {
  text-align: center;
  padding: 12px;
  color: #a1a1a1;
  font-size: 13px;
  background: #202020;
  border-radius: 8px;
  border: 1px solid #2a2a2a;
  margin-bottom: 8px;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.message-group { display: flex; gap: 12px; }
.message-group.message-highlighted .message-content { 
  background: #2a2a2a; 
  border-color: #6D5DDE;
  box-shadow: 0 0 12px rgba(109, 93, 222, 0.2);
}
.message-avatar { width: 36px; height: 36px; border-radius: 50%; background: #6D5DDE; display: flex; align-items: center; justify-content: center; color: white; font-weight: 600; font-size: 14px; flex-shrink: 0; overflow: hidden; position: relative; background-size: cover; background-position: center; background-repeat: no-repeat; transition: transform 0.2s ease; }
.message-avatar.has-image { color: transparent; }
.message-group:hover .message-avatar { transform: scale(1.02); }
.message-content { flex: 1; background: #202020; border-radius: 8px; padding: 12px 16px; border: 1px solid #2a2a2a; min-width: 0; word-wrap: break-word; overflow-wrap: break-word; }
.message-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.message-author { font-weight: 600; color: #e4e4e4; font-size: 14px; }
.message-timestamp { font-size: 11px; color: #a1a1a1; }
.message-text { color: #e4e4e4; line-height: 1.5; word-wrap: break-word; overflow-wrap: break-word; white-space: pre-wrap; word-break: break-word; }
.message-actions { margin-left: auto; position: relative; display: flex; align-items: center; }
.message-menu-trigger { background: none; border: none; color: #9ca3af; font-size: 16px; line-height: 1; padding: 4px 6px; border-radius: 6px; cursor: pointer; transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease; opacity: 0; visibility: hidden; }
.message-group:hover .message-menu-trigger,
.message-actions.open .message-menu-trigger,
.message-menu-trigger:focus,
.message-menu-trigger:focus-visible { opacity: 1; visibility: visible; }
.message-menu-trigger:hover,
.message-menu-trigger:focus,
.message-menu-trigger:focus-visible { color: #f1f5f9; background: rgba(255, 255, 255, 0.06); }
.message-menu { position: absolute; top: calc(100% + 6px); right: 0; background: #181818; border: 1px solid #2a2a2a; border-radius: 8px; min-width: 160px; padding: 6px 0; box-shadow: 0 18px 38px rgba(0, 0, 0, 0.45); display: none; z-index: 15; }
.message-actions.open .message-menu { display: flex; flex-direction: column; }
/* Support for fixed positioning context menu */
.message-actions.open .message-menu[style*="position: fixed"] { position: fixed !important; }
.message-menu-item { background: none; border: none; color: #e4e4e4; font-size: 13px; padding: 8px 14px; text-align: left; cursor: pointer; transition: background 0.2s ease, color 0.2s ease; width: 100%; }
.message-menu-item:hover,
.message-menu-item:focus,
.message-menu-item:focus-visible { background: rgba(255, 255, 255, 0.08); color: #f8fafc; }
.message-menu-item.message-action-delete { color: #f87171; }
.message-menu-item.message-action-delete:hover,
.message-menu-item.message-action-delete:focus,
.message-menu-item.message-action-delete:focus-visible { background: rgba(248, 113, 113, 0.18); color: #fee2e2; }
.message-input-area { padding: 20px 24px; background: #202020; border-top: 1px solid #2a2a2a; }
.input-wrapper { display: flex; gap: 12px; align-items: flex-end; }
.message-input { flex: 1; background: #181818; border: 2px solid #2a2a2a; border-radius: 8px; padding: 12px 16px; resize: none; font-family: inherit; font-size: 14px; color: #e4e4e4; transition: all 0.2s ease; max-height: 120px; }
.message-input:focus { outline: none; border-color: #4a4a4a; box-shadow: 0 0 0 2px rgba(74, 74, 74, 0.2); }
.message-input::placeholder { color: #a1a1a1; }
.message-input.disabled,
.message-input:disabled { 
  background: #141414; 
  border-color: #252525; 
  color: #6b6b6b; 
  cursor: not-allowed; 
  opacity: 0.7;
}
.message-input.disabled::placeholder,
.message-input:disabled::placeholder { 
  color: #787878; 
  font-style: italic;
}
.send-btn { padding: 0 14px; height: 44px; background: #3a3a3a; border: none; border-radius: 8px; color: #e4e4e4; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; display: inline-flex; align-items: center; justify-content: center; }
.send-btn:hover { background: #4a4a4a; }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.emoji-btn:disabled,
.gif-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.75); display: none; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(6px); padding: 20px; }
.modal-overlay[data-depth="base"] { z-index: 1000; }
.modal-overlay[data-depth="raised"] { z-index: 1100; }
.modal-overlay[data-depth="pinnacle"] { z-index: 1200; }
.modal { background: #1a1a1a; border-radius: 16px; padding: 32px; width: 440px; max-width: 90vw; border: 1px solid #2a2a2a; position: relative; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5); }
.modal-title { font-size: 24px; font-weight: 700; color: #ffffff; margin-bottom: 10px; letter-spacing: -0.5px; }
.modal-subtitle { color: #999; font-size: 15px; line-height: 1.4; }
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; color: #a5b4fc; margin-bottom: 10px; letter-spacing: 0.8px; }
.form-input { width: 100%; background: #0f0f0f; border: 2px solid #2a2a2a; border-radius: 10px; padding: 14px 18px; color: #e4e4e4; font-size: 14px; transition: all 0.15s ease; }
.form-input:focus { outline: none; border-color: rgba(99, 102, 241, 0.6); background: #1a1a1a; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }
.btn { background: #3a3a3a; color: white; border: none; border-radius: 10px; padding: 13px 26px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; width: 100%; }
.btn:hover { background: #4a4a4a; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }
.btn:active { transform: translateY(0); }
.btn-secondary { background: #2a2a2a; color: #e4e4e4; border: 1px solid #3a3a3a; }
.btn-secondary:hover { background: #3a3a3a; border-color: #4a4a4a; }
.btn.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  border: 1px solid rgba(99, 102, 241, 0.5);
  color: #f8fafc;
  width: auto;
  padding: 13px 28px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
}
.btn.btn-primary:hover {
  background: linear-gradient(135deg, #4338ca, #4f46e5);
  border-color: rgba(99, 102, 241, 0.8);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}
.btn.btn-primary:active {
  background: linear-gradient(135deg, #3730a3, #4338ca);
}
.modal-footer { display: flex; gap: 12px; margin-top: 24px; }
.close-btn { position: absolute; top: 20px; right: 24px; background: rgba(26, 26, 26, 0.92); border: 1px solid rgba(58, 58, 58, 0.8); color: #b5b5b5; font-size: 18px; cursor: pointer; padding: 8px; border-radius: 10px; transition: all 0.15s ease; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(6px); z-index: 25; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
.close-btn:hover { background: rgba(44, 44, 44, 0.95); color: #f1f1f1; border-color: #6D5DDE; box-shadow: 0 8px 22px rgba(109, 93, 222, 0.35); }

/* Scrollbars */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #202020; border-radius: 3px; }
::-webkit-scrollbar-thumb { background: #2c2c2c; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #353535; }

/* Utils */
.hidden { display: none !important; }
.loading { opacity: 0.6; pointer-events: none; }
.pulse { animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
.invite-code-display { background: #181818; border: 1px solid #2a2a2a; border-radius: 6px; padding: 8px 12px; margin: 8px 0; font-family: monospace; font-size: 12px; color: #e4e4e4; display: flex; justify-content: space-between; align-items: center; }
.copy-btn { padding: 4px 8px; background: #3a3a3a; color: #e4e4e4; border: none; border-radius: 4px; font-size: 10px; cursor: pointer; }
.copy-btn:hover { background: #4a4a4a; }

/* Channel Permissions Modal */
.channel-permissions-content {
  margin-top: 20px;
}

.roles-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 400px;
  overflow-y: auto;
  background: #0f0f0f;
  border: 2px solid #2a2a2a;
  border-radius: 10px;
  padding: 12px;
}

.role-checkbox-label {
  display: flex;
  align-items: center;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.role-checkbox-label:hover {
  background: #2a2a2a;
}

.role-checkbox-label input[type="checkbox"] {
  margin-right: 8px;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.notification-stack {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1200;
  width: min(320px, calc(100vw - 32px));
}

/* Notification card base */
.notification-card {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px 12px 12px;
  background: linear-gradient(180deg, rgba(24,24,24,0.9), #151515);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.04);
  box-shadow: 0 10px 30px rgba(3,7,18,0.6), inset 0 1px 0 rgba(255,255,255,0.02);
  animation: notification-enter 220ms cubic-bezier(.22,.9,.32,1);
}

/* Accent strip on the left to indicate type/status */
.notification-accent {
  width: 6px;
  border-radius: 6px;
  flex: none;
  margin-right: 8px;
}

.overview-card {
  position: relative;
  background: #161d28;
  border-radius: 16px;
  border: 1px solid #222a38;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.overview-card.primary {
  grid-column: span 2;
  min-height: 180px;
}
.notification-card.warning .notification-accent {
  background: #f59e0b;
}

.notification-card.info .notification-accent {
  background: #3b82f6;
}

.notification-card.success .notification-accent { background: #10b981; }
.notification-card.error .notification-accent { background: #ef4444; }

.notification-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notification-title {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.2px;
}

.notification-message {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.4;
}

.notification-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.notification-close:hover {
  background: rgba(148, 163, 184, 0.16);
  color: #e2e8f0;
}

.member-roles-card .notification-close {
  top: 14px;
  right: 14px;
}

.notification-card.leaving {
  animation: notification-leave 0.22s ease-in forwards;
}

/* make stack sit nicely on small screens */
@media (max-width: 560px) {
  .notification-stack {
    left: 12px;
    right: 12px;
    top: 12px;
    width: auto;
    align-items: stretch;
  }

  .notification-card { padding-right: 44px; }
}

@keyframes notification-enter {
  0% { opacity: 0; transform: translateY(-8px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes notification-leave {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-6px) scale(0.96); }
}

@media (max-width: 900px) {
  .members-columns {
    grid-template-columns: 1fr;
  }

  .member-roles-editor {
    position: relative;
    top: 0;
  }

  .roles-layout {
    grid-template-columns: 1fr;
  }

  .role-detail-pane {
    position: relative;
  }

  .role-card {
    flex-direction: column;
    align-items: stretch;
  }

  .role-card-actions {
    flex-direction: row;
    justify-content: flex-end;
    margin-top: 12px;
  }
}

@media (max-width: 1100px) {
  .settings-content {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    flex-direction: column;
    padding: 12px;
    max-height: 220px;
    overflow-y: auto;
  }

  .settings-nav-btn {
    width: 100%;
    text-align: left;
  }

  .section-intro {
    flex-direction: column;
    align-items: stretch;
  }

  .section-intro .btn {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .settings-shell {
    padding: 24px 16px;
  }

  .settings-meta {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
  }

  .settings-meta-item {
    width: 100%;
    padding: 12px 14px;
    background: #1a2231;
    border-radius: 10px;
    border: 1px solid #232c3a;
  }

  .settings-meta-divider {
    display: none;
  }

  .settings-header-top {
    gap: 16px;
  }

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

  .overview-card.primary {
    grid-column: span 1;
  }

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

/* Role and Member Management */
.roles-header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.role-search {
  position: relative;
  flex: 1 1 220px;
  max-width: 320px;
}

.role-search .form-input {
  padding-right: 16px;
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(99, 102, 241, 0.25);
  color: #e2e8f0;
}

.role-search .form-input:focus {
  border-color: rgba(129, 140, 248, 0.6);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.roles-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 360px);
  gap: 20px;
  align-items: stretch;
  min-height: 0;
}

.roles-pane {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
}

.roles-stats-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(17, 24, 39, 0.55);
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 12px;
}

.role-stat-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(76, 29, 149, 0.22);
  border: 1px solid rgba(129, 140, 248, 0.3);
  box-shadow: 0 8px 18px rgba(99, 102, 241, 0.12);
}

.pill-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(226, 232, 240, 0.7);
}

.pill-value {
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
}

.pill-foot {
  font-size: 11px;
  color: rgba(226, 232, 240, 0.6);
}

.roles-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.role-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(99, 102, 241, 0.16);
  border-radius: 12px;
  padding: 15px 18px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.role-card:hover {
  border-color: rgba(129, 140, 248, 0.38);
  background: rgba(30, 41, 59, 0.7);
  transform: translateY(-1px);
}

.role-card.active {
  border-color: rgba(129, 140, 248, 0.7);
  background: rgba(76, 29, 149, 0.28);
  box-shadow: 0 16px 28px rgba(99, 102, 241, 0.18);
}

.role-card-main {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
}

.role-avatar {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #0f172a;
  background: rgba(226, 232, 240, 0.9);
  box-shadow: inset 0 0 0 2px rgba(15, 23, 42, 0.35);
  flex-shrink: 0;
}

.role-avatar.default {
  background: rgba(129, 140, 248, 0.35);
  color: #c7d2fe;
}

.role-card-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.role-card-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.role-card-name {
  font-size: 16px;
  font-weight: 600;
  color: #f1f5f9;
}

.role-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: rgba(226, 232, 240, 0.7);
  font-size: 12px;
  letter-spacing: 0.2px;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.25);
  font-size: 11px;
  font-weight: 600;
  color: #bfdbfe;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.role-chip.neutral {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.2);
  color: rgba(226, 232, 240, 0.8);
}

.role-card-permissions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 64px;
  overflow: hidden;
}

.role-permission-pill {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(59, 130, 246, 0.16);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  color: rgba(226, 232, 240, 0.82);
}

.role-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.role-card-actions .btn-small {
  min-width: 92px;
}

.roles-empty {
  border: 1px dashed rgba(148, 163, 184, 0.32);
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  color: rgba(226, 232, 240, 0.75);
}

.roles-empty .empty-icon {
  width: 60px;
  height: 60px;
  font-size: 28px;
  border-radius: 14px;
  background: rgba(99, 102, 241, 0.15);
  color: #c7d2fe;
}

.role-detail-pane {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  min-height: 0;
}

.role-inspector {
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(99, 102, 241, 0.24);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.32);
}

.role-inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.role-inspector-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  background: rgba(226, 232, 240, 0.9);
  box-shadow: inset 0 0 0 2px rgba(15, 23, 42, 0.2);
}

.role-inspector-meta {
  flex: 1;
}

.role-inspector-meta h4 {
  margin: 0 0 4px 0;
  font-size: 17px;
  font-weight: 600;
  color: #f8fafc;
}

.role-inspector-meta p {
  margin: 0;
  font-size: 13px;
  color: rgba(226, 232, 240, 0.7);
}

.role-inspector-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  padding: 16px;
}

.role-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.role-stat .stat-label {
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(148, 163, 184, 0.85);
  text-transform: uppercase;
}

.role-stat .stat-value {
  font-size: 18px;
  font-weight: 600;
  color: #f8fafc;
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: rgba(148, 163, 184, 0.2);
}

.role-inspector-permissions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.permission-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.permission-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.18);
  color: rgba(226, 232, 240, 0.85);
  font-size: 12px;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.role-creation-form {
  margin-bottom: 0;
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 16px;
  padding: 0;
  background: rgba(15, 23, 42, 0.6);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.32);
}

.role-creation-form .form-card {
  background: transparent;
  border: none;
}

.role-creation-form .form-card-header {
  background: rgba(15, 23, 42, 0.75);
}

.role-inspector-empty {
  background: rgba(15, 23, 42, 0.55);
  border: 1px dashed rgba(99, 102, 241, 0.26);
  border-radius: 14px;
  padding: 28px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: rgba(226, 232, 240, 0.75);
}

.role-inspector-empty .empty-icon {
  width: 70px;
  height: 70px;
  font-size: 30px;
  border-radius: 16px;
  background: rgba(168, 85, 247, 0.18);
  color: #f5d0fe;
}

.members-content {
  max-height: 500px;
  overflow-y: auto;
}

.members-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.member-item {
  background: rgba(15, 23, 42, 0.55);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.member-item:hover {
  border-color: rgba(129, 140, 248, 0.35);
  background: rgba(30, 41, 59, 0.75);
}

.member-item.active {
  border-color: rgba(129, 140, 248, 0.75);
  background: rgba(76, 29, 149, 0.32);
  box-shadow: 0 16px 26px rgba(99, 102, 241, 0.18);
}

.member-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.member-name {
  font-weight: 600;
  color: #f8fafc;
  font-size: 15px;
}

.member-roles {
  font-size: 13px;
  color: rgba(226, 232, 240, 0.7);
  margin-top: 4px;
}

.member-actions {
  display: flex;
  gap: 10px;
}

.permission-item { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  padding: 12px 16px; 
  background: #222; 
  border-radius: 8px;
  border: 1px solid #2a2a2a;
  transition: all 0.15s ease;
}

.permission-item:hover {
  background: #262626;
  border-color: #3a3a3a;
}

.permission-item input[type="checkbox"] { 
  margin: 0;
  transform: scale(1.1);
}

.permission-label { 
  font-size: 14px; 
  color: #e4e4e4;
  font-weight: 500;
  cursor: pointer;
}

.permission-color-indicator {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.permissions-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); 
  gap: 12px; 
  margin-top: 16px;
}

.members-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 20px;
  align-items: start;
}

.member-roles-editor {
  position: sticky;
  top: 32px;
}

.member-roles-card {
  background: #202020;
  border-radius: 12px;
  border: 1px solid #2c2c2c;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  position: relative;
}

.member-roles-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.member-roles-info {
  display: flex;
  gap: 12px;
  align-items: center;
}

.member-roles-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #39425a;
  color: #fff;
  font-weight: 600;
}

.member-roles-text h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #f5f5f5;
}

.member-roles-text p {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: #9ca3af;
}

.member-roles-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.member-roles-actions {
  display: flex;
  justify-content: flex-end;
}

.member-roles-actions .btn {
  width: auto;
  min-width: 160px;
}

/* Inline Role Creation Form */
.role-creation-form {
  margin-bottom: 24px;
  border-bottom: 1px solid #2a2a2a;
  padding-bottom: 24px;
}

.form-card {
  background: #222;
  border-radius: 12px;
  border: 1px solid #2a2a2a;
  overflow: hidden;
}

.form-card-header {
  background: #1a1a1a;
  padding: 16px 20px;
  border-bottom: 1px solid #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-card-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.form-card .form-group {
  margin-bottom: 16px;
}

.form-card .form-input {
  background: #0f0f0f;
  border: 1px solid #2a2a2a;
}

.form-card .form-input:focus {
  border-color: #4a4a4a;
  background: #1a1a1a;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
}

.form-row .form-group:last-child {
  width: 120px;
}

.form-card > .form-group,
.form-row,
.form-actions {
  padding: 0 20px;
}

.form-card > .form-group:first-of-type,
.form-row:first-of-type {
  padding-top: 20px;
}

.form-actions {
  padding: 16px 20px 20px 20px;
  display: flex;
  gap: 12px;
}

.form-actions .btn {
  width: auto;
  min-width: 120px;
}

.hidden { display: none !important; }
.notification-actions .btn { width: auto; min-width: 80px; }

/* Server Settings Modal */

#serverSettingsModal {
  align-items: stretch;
  justify-content: stretch;
}

.settings-shell {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  padding: 40px 48px;
  background: #11161f;
  border-radius: 0;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.settings-close-icon {
  align-self: flex-start;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #1a2231;
  border: 1px solid #2c3442;
  color: #f8fafc;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  margin-left: auto;
}

.settings-close-icon:hover,
.settings-close-icon:focus {
  background: #222c3d;
  border-color: #3a4454;
  color: #f1f5f9;
  outline: none;
}

.settings-close-icon:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

.settings-header {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #1f2633;
  margin-bottom: 24px;
}

.settings-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}

.settings-title-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 320px;
}

.settings-kicker {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  color: #6b7280;
  font-weight: 600;
}


.settings-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  background: #141a24;
  border-radius: 12px;
  padding: 12px 18px;
  border: 1px solid #222a38;
  width: 100%;
}

.settings-meta-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.settings-meta-label {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #9ca3af;
}

.settings-meta-value {
  font-size: 16px;
  font-weight: 600;
  color: #e2e8f0;
}

.settings-meta-divider {
  width: 1px;
  height: 32px;
  background: rgba(148, 163, 184, 0.18);
}

.settings-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  flex: 1;
  min-height: 0;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: #141a24;
  border: 1px solid #1f2633;
  border-radius: 12px;
  overflow-y: auto;
  min-height: 0;
}

.settings-nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #cbd5f5;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.settings-nav-btn:hover,
.settings-nav-btn:focus {
  background: #1a2231;
  border-color: #273142;
  color: #f8fafc;
  outline: none;
}

.settings-nav-btn.active {
  background: #202a3a;
  border-color: #394252;
  color: #ffffff;
}

.settings-nav-btn:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

.settings-panels {
  background: #141a24;
  border: 1px solid #1f2633;
  border-radius: 12px;
  padding: 24px;
  overflow-y: auto;
  min-height: 0;
}

.settings-panel {
  display: none;
}

.settings-panel.active {
  display: block;
}

.section-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 22px;
}

.section-intro h3 {
  font-size: 20px;
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 6px;
}

.section-intro p {
  color: #94a3b8;
  font-size: 14px;
  max-width: 480px;
}

.section-intro .btn {
  width: auto;
  white-space: nowrap;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.overview-card {
  position: relative;
  background: #161d28;
  border-radius: 16px;
  border: 1px solid #222a38;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.overview-card.primary {
  grid-column: span 2;
  min-height: 180px;
}

.overview-footnote {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
  color: #cbd5f5;
}

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

#overviewInviteCode {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: #e2e8f0;
}

.stat-label {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.75);
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: #f8fafc;
}

.stat-sub {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.85);
}

/* Overview Panel */
.overview-content { 
  display: flex; 
  flex-direction: column; 
  gap: 32px; 
}

.server-info-card { 
  background: #1a2230; 
  border-radius: 12px; 
  padding: 24px; 
  display: flex; 
  align-items: center; 
  gap: 20px;
  border: 1px solid #273042;
}

.server-icon { 
  width: 72px; 
  height: 72px; 
  background: #2f3a4f; 
  border-radius: 16px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  color: white; 
  font-size: 28px; 
  font-weight: 600;
  flex-shrink: 0;
}

.server-details h4 { 
  font-size: 20px; 
  color: #ffffff; 
  margin: 0 0 6px 0;
  font-weight: 600;
}

.server-details p { 
  font-size: 14px; 
  color: #999; 
  margin: 0; 
}

.stats-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); 
  gap: 20px; 
}

.stat-card { 
  background: #222; 
  border-radius: 12px; 
  padding: 20px; 
  text-align: center;
  border: 1px solid #2a2a2a;
  transition: border-color 0.15s ease;
}

.stat-card:hover {
  border-color: #3a3a3a;
}

.stat-number { 
  font-size: 32px; 
  font-weight: 700; 
  color: #6366f1; 
  margin-bottom: 8px;
  line-height: 1;
}

.stat-label { 
  font-size: 13px; 
  color: #888; 
  text-transform: uppercase; 
  letter-spacing: 0.8px;
  font-weight: 500;
}

/* Channels Panel */
.channels-content { 
  max-height: 500px; 
  overflow-y: auto; 
}

.settings-channels-list { 
  display: flex; 
  flex-direction: column; 
  gap: 12px; 
}

.settings-channel-item { 
  background: #222; 
  border-radius: 10px; 
  padding: 16px; 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  border: 1px solid #2a2a2a;
  transition: all 0.15s ease;
}

.settings-channel-item:hover {
  background: #262626;
  border-color: #3a3a3a;
}

.settings-channel-info { 
  display: flex; 
  align-items: center; 
  gap: 14px; 
}

.settings-channel-hash { 
  width: 24px; 
  height: 24px; 
  background: #4a4a4a; 
  border-radius: 6px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  color: white; 
  font-size: 13px;
  font-weight: 600;
}

.settings-channel-name { 
  font-weight: 600; 
  color: #ffffff;
  font-size: 15px;
}

.settings-channel-actions { 
  display: flex; 
  gap: 10px; 
}

/* Invites Panel */
.invites-content { 
  display: flex; 
  flex-direction: column; 
  gap: 24px; 
}

.invite-code-wrapper { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  background: #0f0f0f; 
  border: 1px solid #2a2a2a; 
  border-radius: 10px; 
  padding: 16px 20px;
  transition: border-color 0.15s ease;
}

.invite-code-wrapper:hover {
  border-color: #3a3a3a;
}

.invite-code-wrapper code { 
  flex: 1; 
  font-family: 'JetBrains Mono', 'Fira Code', monospace; 
  font-size: 15px; 
  color: #e4e4e4;
  background: none; 
  border: none;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.invite-code-wrapper .copy-btn {
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  color: #e4e4e4;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.invite-code-wrapper .copy-btn:hover {
  background: #3a3a3a;
  border-color: #4a4a4a;
}

/* Unread badges */
.unread-badge, .channel-unread-badge, .server-unread-badge, .tab-unread-badge {
  background: #6D5DDE;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.unread-badge {
  margin-top: 2px;
}

.channel-unread-badge {
  margin-left: auto;
  margin-right: 8px;
}

.server-unread-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  padding: 2px 5px;
}

.tab-unread-badge {
  margin-left: 6px;
  font-size: 10px;
  padding: 2px 5px;
}

.server-card {
  position: relative;
}

/* Context Menu */
.context-menu {
  background: #181818;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  min-width: 180px;
  padding: 6px 0;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.15s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.context-menu-item {
  background: none;
  border: none;
  color: #e4e4e4;
  font-size: 13px;
  padding: 8px 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  width: 100%;
}

.context-menu-item:first-child {
  border-radius: 6px 6px 0 0;
}

.context-menu-item:last-child {
  border-radius: 0 0 6px 6px;
}

.context-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

.context-menu-item-danger {
  color: #f87171;
}

.context-menu-item-danger:hover {
  background: rgba(248, 113, 113, 0.18);
  color: #fee2e2;
}

/* Category Styles */
.category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
  border-radius: 4px;
  user-select: none;
}

.category-header[draggable="true"] {
  cursor: grab;
}

.category-header[draggable="true"]:active {
  cursor: grabbing;
}

.category-header.dragging {
  opacity: 0.5;
}

.category-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.category-header.uncategorized {
  margin-top: 16px;
  cursor: default;
}

.category-header.uncategorized:hover {
  background: transparent;
}

.category-toggle {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 12px;
  transition: transform 0.2s ease;
}

.category-name {
  flex: 1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #9ca3af;
}

.category-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.category-header:hover .category-actions {
  opacity: 1;
}

.category-add-btn,
.category-edit-btn {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: transparent;
  color: #9ca3af;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  padding: 0;
}

.category-add-btn:hover,
.category-edit-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e4e4e4;
}

.category-channels {
  margin-left: 8px;
  margin-bottom: 8px;
}

.category-channels.uncategorized {
  margin-left: 0;
}

.category-channels .channel-item {
  margin-bottom: 4px;
}

.channel-item[draggable="true"] {
  cursor: grab;
}

.channel-item[draggable="true"]:active {
  cursor: grabbing;
}

.channel-item.dragging {
  opacity: 0.5;
}

.channel-drop-zone {
  padding: 16px;
  border: 2px dashed #3a3a3a;
  border-radius: 6px;
  text-align: center;
  color: #6b7280;
  font-size: 12px;
  margin: 8px 0;
  transition: all 0.2s ease;
}

.channel-drop-zone.drag-over {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.05);
  color: #6366f1;
}

/* Add Category Button */
#addCategoryBtn {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  background: #262626;
  color: #a1a1a1;
  border: 1px dashed #3a3a3a;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
}

#addCategoryBtn:hover {
  background: #2c2c2c;
  border-color: #4a4a4a;
  color: #e4e4e4;
}


