/* ========================================================
   SayfeVoice — Premium Discord-like Dark UI, 2027 Aesthetic
   Version: 2027-v3
   ======================================================== */

:root {
  /* Core palette */
  --bg: #0a0a0f;
  --bg0: #08080d;
  --bg1: #0f1016;
  --bg2: #15161f;
  --bg3: #1c1e29;
  --bg4: #252737;
  --bg5: #2d3044;
  --bg6: #363a52;
  --text: #f6f7ff;
  --text1: #e0e3f1;
  --text2: #a8adc4;
  --text3: #7b819c;
  --text4: #4f556e;

  /* Accents */
  --accent: #7c5cff;
  --accent2: #00d2ff;
  --accent3: #ff62ba;
  --accent-soft: rgba(124, 92, 255, 0.18);
  --accent2-soft: rgba(0, 210, 255, 0.14);
  --accent3-soft: rgba(255, 98, 186, 0.14);
  --accent-glow: rgba(124, 92, 255, 0.35);
  --accent2-glow: rgba(0, 210, 255, 0.35);

  /* Status colors */
  --status-online: #42f2a2;
  --status-away: #ffcc42;
  --status-dnd: #ff4d6d;
  --status-offline: #7b819c;
  --status-online-soft: rgba(66, 242, 162, 0.18);
  --status-away-soft: rgba(255, 204, 66, 0.18);
  --status-dnd-soft: rgba(255, 77, 109, 0.18);

  /* Feedback */
  --danger: #ff4d6d;
  --danger-soft: rgba(255, 77, 109, 0.15);
  --success: #42f2a2;
  --success-soft: rgba(66, 242, 162, 0.15);
  --warn: #ffcc42;
  --warn-soft: rgba(255, 204, 66, 0.15);
  --info: #00d2ff;
  --info-soft: rgba(0, 210, 255, 0.15);

  /* Premium / Nitro/Boost accents */
  --premium: #ff62ba;
  --premium-soft: rgba(255, 98, 186, 0.15);
  --boost: #f47fff;
  --boost-soft: rgba(244, 127, 255, 0.15);
  --nitro-glow: 0 0 30px rgba(255, 98, 186, 0.45);

  /* Glass */
  --glass: rgba(255, 255, 255, 0.04);
  --glass2: rgba(255, 255, 255, 0.08);
  --glass3: rgba(255, 255, 255, 0.12);
  --glass4: rgba(255, 255, 255, 0.18);
  --border: rgba(255, 255, 255, 0.07);
  --border2: rgba(255, 255, 255, 0.12);
  --border3: rgba(255, 255, 255, 0.18);

  /* Radius */
  --radius-xl: 24px;
  --radius: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --radius-xxs: 6px;

  /* Shadows */
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 10px 28px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 40px var(--accent-glow);
  --shadow-accent: 0 8px 24px rgba(124, 92, 255, 0.28);

  /* Typography */
  --font: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  --transition: 0.2s cubic-bezier(0.22, 0.61, 0.36, 1);
  --transition-fast: 0.12s ease;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

button,
input,
textarea,
select {
  font-family: inherit;
  font-size: 15px;
  color: inherit;
}

button {
  border: none;
  cursor: pointer;
  background: transparent;
}

input,
textarea,
select {
  outline: none;
}

#app {
  display: flex;
  height: 100vh;
  width: 100vw;
  background:
    radial-gradient(1300px 900px at 5% 0%, var(--accent-soft) 0%, transparent 55%),
    radial-gradient(1100px 700px at 95% 10%, var(--accent2-soft) 0%, transparent 55%),
    radial-gradient(900px 600px at 80% 100%, var(--accent3-soft) 0%, transparent 55%),
    var(--bg);
}

/* ================= AUTH SCREEN ================= */
#auth-screen {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  flex-direction: column;
  animation: fadeIn 0.35s ease;
}

#auth-screen.active {
  display: flex;
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border2);
}

.auth-card {
  width: 440px;
  max-width: 92%;
  padding: 38px;
  border-radius: var(--radius);
  text-align: center;
  border: 1px solid var(--border2);
  box-shadow: var(--shadow), 0 0 80px rgba(124, 92, 255, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.08), transparent 40%, rgba(0, 210, 255, 0.06));
}

.logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}

.logo {
  width: 220px;
  height: 74px;
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.auth-card .sub {
  color: var(--text2);
  margin: 0 0 22px;
  font-size: 14px;
}

.privacy-usp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(66, 242, 162, 0.28);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
  box-shadow: 0 0 20px rgba(66, 242, 162, 0.12);
}

.privacy-usp.small {
  padding: 6px 12px;
  font-size: 12px;
  margin-top: 14px;
  margin-bottom: 0;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  background: var(--bg2);
  padding: 5px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 11px;
  border-radius: 10px;
  background: transparent;
  color: var(--text2);
  font-size: 14px;
  font-weight: 700;
  transition: var(--transition-fast);
  border: 1px solid transparent;
}

.tab:hover {
  color: var(--text);
  background: var(--bg3);
}

.tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.32);
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.auth-form.active {
  display: flex;
}

.auth-form input {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  transition: var(--transition-fast);
}

.auth-form input:focus {
  border-color: var(--accent);
  background: var(--bg3);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.16);
}

.btn-primary {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  transition: var(--transition-fast);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.26);
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 10px 28px rgba(124, 92, 255, 0.38);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.btn-secondary {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg4);
  color: var(--text);
  font-weight: 600;
  border: 1px solid var(--border);
  transition: var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg5);
  border-color: var(--border2);
}

.btn-secondary.danger {
  background: var(--danger);
  color: #fff;
  border-color: transparent;
}

.btn-secondary.danger:hover {
  filter: brightness(1.12);
}

.error {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  margin-top: 4px;
}

/* ================= MAIN SCREEN ================= */
#main-screen {
  display: none;
  flex: 1;
  height: 100%;
}

#main-screen.active {
  display: flex;
}

/* Server Sidebar */
.server-sidebar {
  width: 72px;
  min-width: 72px;
  background: var(--bg1);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0 16px;
  gap: 8px;
  border-right: none;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
}

.server-sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.server-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: border-radius 0.22s ease, background 0.22s ease, transform 0.18s ease, box-shadow 0.22s ease;
  border: none;
  overflow: hidden;
  color: var(--text);
  position: relative;
  flex-shrink: 0;
}

.server-icon::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 4px;
  height: 0;
  border-radius: 0 3px 3px 0;
  background: var(--text);
  transition: height 0.22s ease, transform 0.22s ease;
}

.server-icon:hover,
.server-icon.active {
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(124, 92, 255, 0.28);
}

.server-icon.active::before {
  transform: translateY(-50%) scaleY(1);
  height: 36px;
}

.server-icon:hover::before {
  transform: translateY(-50%) scaleY(1);
  height: 20px;
}

.server-icon.home {
  font-size: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}

.server-icon.home .home-icon {
  font-weight: 800;
}

.server-icon.add,
.server-icon.public {
  color: var(--success);
  font-size: 24px;
}

.server-icon.add:hover,
.server-icon.public:hover {
  background: var(--success);
  color: var(--bg);
}

.server-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.server-divider {
  width: 32px;
  height: 2px;
  border-radius: 1px;
  background: var(--border2);
  margin: 4px 0;
  flex-shrink: 0;
}

.server-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  align-items: center;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
}

.server-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.server-unread-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg1);
  box-shadow: 0 2px 8px rgba(255, 77, 109, 0.35);
}

.server-icon.premium {
  border: 1px solid rgba(255, 98, 186, 0.4);
  box-shadow: inset 0 0 12px rgba(255, 98, 186, 0.12);
}

.server-icon.premium.active,
.server-icon.premium:hover {
  background: linear-gradient(135deg, var(--premium), var(--boost));
  box-shadow: var(--nitro-glow);
}

/* Mobile Server Nav */
.mobile-server-nav {
  display: none;
  flex-direction: row;
  width: 100%;
  height: 62px;
  min-height: 62px;
  padding: 0 10px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: var(--bg1);
  align-items: center;
  gap: 10px;
}

.mobile-server-nav::-webkit-scrollbar {
  height: 0;
}

.mobile-server-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  transition: var(--transition-fast);
}

.mobile-server-icon.active {
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}

.mobile-server-list {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

/* Channel Panel */
.channel-panel {
  width: 260px;
  min-width: 260px;
  background: var(--bg2);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
}

.channel-panel::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  pointer-events: none;
}

.channel-header {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
  flex-shrink: 0;
}

.channel-header .header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text2);
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  border: 1px solid transparent;
}

.icon-btn:hover {
  background: var(--glass2);
  color: var(--text);
  border-color: var(--border);
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: scale(0.96);
}

.icon-btn.send {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(124, 92, 255, 0.28);
}

.icon-btn.send:hover {
  background: var(--accent2);
  box-shadow: 0 6px 20px rgba(0, 210, 255, 0.32);
}

.icon-btn.mobile-only {
  display: none;
}

.header-actions {
  display: flex;
  gap: 6px;
}

.channel-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
}

.channel-category {
  color: var(--text3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  margin: 16px 0 8px;
  padding: 0 6px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.channel-category:first-child {
  margin-top: 0;
}

.channel-item {
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  transition: var(--transition-fast);
  margin-bottom: 2px;
  user-select: none;
  position: relative;
}

.channel-item:hover {
  background: var(--bg4);
  color: var(--text);
}

.channel-item.active {
  background: var(--glass2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border2);
}

.channel-item.joined {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(66, 242, 162, 0.2);
}

.channel-item .channel-icon {
  font-size: 15px;
  opacity: 0.85;
}

.channel-item .badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 10px;
  padding: 2px 7px;
  box-shadow: 0 2px 8px rgba(255, 77, 109, 0.3);
}

.channel-item .voice-count {
  margin-left: auto;
  background: var(--bg4);
  color: var(--text2);
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 2px 7px;
  border: 1px solid var(--border);
}

.channel-item .voice-count.active {
  background: var(--success);
  color: var(--bg);
}

.user-bar {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg2);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  padding: 4px;
  border-radius: 10px;
  transition: var(--transition-fast);
  position: relative;
}

.user-info:hover {
  background: var(--bg4);
}

.user-info .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  color: #fff;
  border: 2px solid var(--bg2);
  position: relative;
}

.user-info .meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-info .name {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.user-info .status {
  font-size: 11px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 5px;
}

.user-info .status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  border: 1.5px solid var(--bg2);
}

.user-info .status.online {
  color: var(--status-online);
}

.user-info .status.online::before {
  background: var(--status-online);
  box-shadow: 0 0 8px var(--status-online);
}

.user-info .status.away {
  color: var(--status-away);
}

.user-info .status.away::before {
  background: var(--status-away);
  box-shadow: 0 0 8px var(--status-away);
}

.user-info .status.dnd {
  color: var(--status-dnd);
}

.user-info .status.dnd::before {
  background: var(--status-dnd);
  box-shadow: 0 0 8px var(--status-dnd);
}

.user-info .status.offline {
  color: var(--status-offline);
}

.user-info .status.offline::before {
  background: var(--status-offline);
}

.user-info .custom-status {
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-actions {
  display: flex;
  gap: 4px;
}

/* Content Area */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
  position: relative;
}

.view {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.view.active {
  display: flex;
}

.content-header {
  padding: 24px 30px;
  border-bottom: 1px solid var(--border);
}

.content-header h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.content-header p {
  margin: 0;
  color: var(--text2);
  font-size: 14px;
}

/* Home View */
.home-view {
  flex: 1;
  flex-direction: column;
  min-width: 0;
  background: var(--bg1);
}

/* Home Header — Discord-Style */
.home-header {
  height: 56px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg1);
  flex-shrink: 0;
}

.home-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 16px;
  min-width: 0;
}

.home-header-title .friends-icon {
  width: 22px;
  height: 22px;
  color: var(--text3);
  flex-shrink: 0;
}

.home-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.home-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
  min-width: 0;
  scrollbar-width: none;
}

.home-tabs::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.home-tabs .tab {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
  background: transparent;
  border: 1px solid transparent;
  transition: var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
}

.home-tabs .tab:hover {
  color: var(--text);
  background: var(--bg3);
}

.home-tabs .tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 4px 14px rgba(124, 92, 255, 0.28);
}

.btn-add-friend-header {
  padding: 8px 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, #5865F2, #7c5cff);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.12);
  transition: var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
}

.btn-add-friend-header:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(88, 101, 242, 0.32);
}

.btn-add-friend-header.active {
  color: #fff;
  background: var(--success);
  border-color: transparent;
}

/* Home DM Section */
.home-dm-section {
  padding: 12px 16px 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.home-dm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.home-section-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text3);
}

.home-dm-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  min-height: 0;
  padding-right: 2px;
}

.home-dm-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
}

.home-dm-item:hover {
  background: var(--bg3);
  border-color: rgba(255,255,255,0.04);
}

.home-dm-item.active {
  background: var(--glass);
  border-color: rgba(124, 92, 255, 0.22);
}

.home-dm-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.home-dm-avatar-wrap .avatar {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.home-dm-avatar-wrap .status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg1);
  background: var(--offline);
}

.home-dm-avatar-wrap .status-dot.online { background: var(--success); }
.home-dm-avatar-wrap .status-dot.away { background: var(--warning); }
.home-dm-avatar-wrap .status-dot.dnd { background: var(--danger); }
.home-dm-avatar-wrap .status-dot.invisible,
.home-dm-avatar-wrap .status-dot.offline { background: var(--offline); }

.home-dm-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.home-dm-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.home-dm-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-dm-time {
  font-size: 11px;
  color: var(--text3);
  flex-shrink: 0;
}

.home-dm-preview {
  font-size: 13px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-dm-unread {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.home-empty-dm {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 16px;
  text-align: center;
  color: var(--text3);
  font-size: 13px;
}

.home-empty-dm .empty-icon {
  font-size: 28px;
  opacity: 0.8;
}

/* Home Body */
.home-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
  background: var(--bg1);
}

.home-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
}

.home-sidebar {
  width: 260px;
  min-width: 260px;
  border-left: 1px solid var(--border);
  background: var(--bg1);
  padding: 16px;
  overflow-y: auto;
  flex-shrink: 0;
}

.home-sidebar h3 {
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text);
}

/* Search Section */
.home-search-section {
  padding: 16px 24px 12px;
}

.home-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--bg0);
  border: 1px solid var(--border);
}

.home-search-wrap .search-icon {
  font-size: 14px;
  color: var(--text3);
}

.home-search-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.home-search-wrap input::placeholder {
  color: var(--text3);
}

.home-search-wrap:focus-within {
  border-color: var(--accent);
}

/* Friends List Section */
.home-list-section {
  flex: 1;
  padding: 0 24px 24px;
}

.friends-section-title {
  margin: 0 0 8px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text3);
}

.friends-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.friend-group-title {
  padding: 18px 10px 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text3);
}

.friend-group-title.with-border {
  border-top: 1px solid var(--border);
}

.friend-group-title:first-child {
  padding-top: 4px;
}

.friend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
}

.friend-item:hover {
  background: var(--bg3);
  border-color: var(--border);
}

.friend-item .avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.friend-item .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  overflow: hidden;
}

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

.friend-item .status-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--status-offline);
  border: 2px solid var(--bg1);
}

.friend-item .status-dot.online { background: var(--status-online); }
.friend-item .status-dot.away { background: var(--status-away); }
.friend-item .status-dot.dnd { background: var(--status-dnd); }
.friend-item .status-dot.offline { background: var(--status-offline); }

.friend-item .meta {
  flex: 1;
  min-width: 0;
}

.friend-item .name {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.friend-item .status {
  font-size: 12px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-item .status.online { color: var(--status-online); }
.friend-item .status.away { color: var(--status-away); }
.friend-item .status.dnd { color: var(--status-dnd); }

.friend-item .actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.friend-item:hover .actions {
  opacity: 1;
}

.friend-item .actions button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  padding: 0;
  background: var(--bg4);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.friend-item .actions button:hover {
  background: var(--accent);
  color: #fff;
}

.friend-item .actions .btn-decline-friend:hover,
.friend-item .actions .btn-unblock-friend:hover {
  background: var(--danger);
}

/* Add Friend Card */
.add-friend-card {
  margin: 0 24px 24px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--bg2);
  border: 1px solid var(--border);
}

.add-friend-card h4 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.add-friend-card p {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text2);
}

.add-friend-card .input-with-btn {
  gap: 10px;
}

.add-friend-card .input-with-btn input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg0);
  color: var(--text);
  font-size: 14px;
}

.add-friend-card .input-with-btn input:focus {
  border-color: var(--accent);
  outline: none;
}

.add-friend-card .btn-primary {
  white-space: nowrap;
}

/* Active Now Sidebar */
.active-now-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.active-now-empty {
  font-size: 13px;
  color: var(--text3);
  line-height: 1.5;
}

.active-now-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition-fast);
}

.active-now-item:hover {
  background: var(--bg3);
  border-color: var(--border2);
}

.active-now-item .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

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

.active-now-item .meta {
  flex: 1;
  min-width: 0;
}

.active-now-item .name {
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.active-now-item .activity {
  font-size: 12px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Search results inside home */
.search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
}

.search-result .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
}

.search-result .meta {
  flex: 1;
}

.search-result .name {
  font-weight: 700;
  font-size: 14px;
}

.search-result .status {
  font-size: 12px;
  color: var(--text3);
}

.search-result button {
  margin-left: auto;
  padding: 7px 13px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.search-result button:hover {
  background: var(--accent2);
}

.empty {
  color: var(--text3);
  font-size: 14px;
  padding: 20px 0;
  text-align: center;
}

/* Chat Views */
.chat-header {
  height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.2px;
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.chat-header-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-header-title {
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-status {
  font-size: 12px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-header-actions {
  display: flex;
  gap: 6px;
}

.typing-indicator {
  font-size: 12px;
  color: var(--text3);
  font-style: italic;
  min-height: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.typing-indicator::before {
  content: '✏️';
}

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

/* Message styling */
.message {
  display: flex;
  gap: 14px;
  animation: msgIn 0.28s ease;
  position: relative;
  padding: 4px 8px;
  margin: 0 -8px;
  border-radius: 8px;
  transition: var(--transition-fast);
}

.message:hover {
  background: rgba(255, 255, 255, 0.03);
}

.message.has-reply {
  padding-top: 24px;
}

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

.message .avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  position: relative;
  cursor: pointer;
  transition: var(--transition-fast);
}

.message .avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 16px var(--accent-glow);
}

.message .body {
  display: flex;
  flex-direction: column;
  max-width: calc(100% - 60px);
  min-width: 0;
}

.message .meta {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 4px;
}

.message .name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text1);
}

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

.message .content {
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
  font-size: 15px;
}

.message .content a {
  color: var(--accent2);
  text-decoration: underline;
}

.message .content code {
  background: var(--bg2);
  padding: 2px 6px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 13px;
}

.message .content pre {
  background: var(--bg2);
  padding: 10px 12px;
  border-radius: 10px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
}

.message.mine {
  flex-direction: row-reverse;
}

.message.mine .body {
  align-items: flex-end;
}

.message-bubble {
  padding: 11px 15px;
  border-radius: 14px 14px 14px 4px;
  max-width: 75%;
  background: var(--bg2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: relative;
}

.message.mine .message-bubble {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border-radius: 14px 14px 4px 14px;
  box-shadow: 0 4px 16px rgba(124, 92, 255, 0.25);
}

.message-bubble:hover {
  filter: brightness(1.04);
}

.message.mine .message-bubble:hover {
  filter: brightness(1.08);
}

.dm-messages .message:not(.mine) .content {
  background: var(--bg2);
  padding: 11px 15px;
  border-radius: 14px 14px 14px 4px;
  max-width: 75%;
  display: inline-block;
}

.dm-messages .message.mine .content {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  padding: 11px 15px;
  border-radius: 14px 14px 4px 14px;
  max-width: 75%;
  display: inline-block;
  box-shadow: 0 4px 16px rgba(124, 92, 255, 0.25);
}

/* Reply / Quote */
.message-reply {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--accent);
  font-size: 13px;
  color: var(--text2);
  max-width: 100%;
  cursor: pointer;
}

.message-reply:hover {
  background: rgba(255, 255, 255, 0.07);
}

.message-reply .reply-name {
  font-weight: 700;
  color: var(--accent2);
}

.message-reply .reply-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.message-reply-to {
  position: absolute;
  top: 0;
  left: 58px;
  font-size: 12px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.message-reply-to::before {
  content: '';
  width: 24px;
  height: 12px;
  border-left: 2px solid var(--text4);
  border-bottom: 2px solid var(--text4);
  border-radius: 0 0 0 6px;
}

/* Reactions */
.reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.reaction {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--bg3);
  border: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
}

.reaction:hover {
  background: var(--bg4);
  border-color: var(--border2);
  transform: translateY(-1px);
}

.reaction.active {
  background: var(--accent-soft);
  border-color: rgba(124, 92, 255, 0.35);
  box-shadow: 0 0 12px rgba(124, 92, 255, 0.12);
}

.reaction .emoji {
  font-size: 15px;
}

.reaction .count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
}

.reaction.active .count {
  color: var(--accent);
}

.reaction-add {
  opacity: 0.6;
  padding: 4px 8px;
}

.reaction-add:hover {
  opacity: 1;
  background: var(--bg4);
}

/* Message hover actions */
.message-actions {
  position: absolute;
  top: -12px;
  right: 12px;
  display: none;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  z-index: 5;
}

.message:hover .message-actions {
  display: flex;
}

.message.mine .message-actions {
  right: auto;
  left: 12px;
}

.message-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text2);
  font-size: 14px;
  transition: var(--transition-fast);
}

.message-action-btn:hover {
  background: var(--bg4);
  color: var(--text);
}

/* Attachments / Upload Preview */
.message-attachment {
  margin-top: 8px;
  max-width: 320px;
}

.message-attachment img,
.message-attachment video {
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.message-attachment .file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg2);
  border: 1px solid var(--border);
}

.message-attachment .file-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.message-attachment .file-meta {
  flex: 1;
  min-width: 0;
}

.message-attachment .file-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-attachment .file-size {
  font-size: 12px;
  color: var(--text3);
}

/* Upload preview overlay */
.upload-preview {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  max-width: 90%;
  width: 420px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg2);
  border: 1px solid var(--border2);
  box-shadow: var(--shadow);
  z-index: 90;
  transition: transform 0.3s ease;
}

.upload-preview.active {
  transform: translateX(-50%) translateY(0);
}

.upload-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.upload-preview-header span {
  font-weight: 700;
  font-size: 14px;
}

.upload-preview-content {
  display: flex;
  gap: 12px;
  overflow-x: auto;
}

.upload-preview-item {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.upload-preview-item img,
.upload-preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-preview-item .remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
}

/* Chat input */
.chat-input {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--bg1);
}

.chat-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg2);
  border: 1px solid var(--border);
  transition: var(--transition-fast);
}

.chat-input-wrapper:focus-within {
  border-color: var(--accent);
  background: var(--bg3);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.1);
}

.chat-input input {
  flex: 1;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  transition: var(--transition-fast);
}

.chat-input input:focus {
  border-color: var(--accent);
  background: var(--bg3);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.12);
}

.reply-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 20px;
  background: var(--bg1);
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text2);
}

.reply-bar.active {
  display: flex;
}

.reply-bar .reply-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reply-bar .reply-info strong {
  color: var(--accent);
}

/* Voice Channel */
.voice-header-status {
  font-size: 12px;
  color: var(--text3);
  font-weight: 500;
}

.voice-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  padding: 26px;
  align-content: start;
  overflow-y: auto;
}

.voice-user {
  aspect-ratio: 16/10;
  border-radius: var(--radius);
  background: var(--bg2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 2px solid transparent;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.voice-user::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.3));
  pointer-events: none;
}

.voice-user:hover {
  background: var(--bg3);
  transform: translateY(-2px);
}

.voice-user.speaking {
  border-color: var(--status-online);
  box-shadow: 0 0 28px rgba(66, 242, 162, 0.35), inset 0 0 20px rgba(66, 242, 162, 0.08);
  animation: speakingPulse 1.4s ease-in-out infinite;
}

@keyframes speakingPulse {
  0%, 100% { box-shadow: 0 0 28px rgba(66, 242, 162, 0.35), inset 0 0 20px rgba(66, 242, 162, 0.08); }
  50% { box-shadow: 0 0 44px rgba(66, 242, 162, 0.55), inset 0 0 30px rgba(66, 242, 162, 0.14); }
}

.voice-user.local {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.15), rgba(0, 210, 255, 0.1));
}

.voice-user .avatar {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  position: relative;
  z-index: 1;
}

.voice-user .name {
  font-weight: 700;
  font-size: 15px;
  position: relative;
  z-index: 1;
}

.voice-user .indicators {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 1;
}

.voice-user .ind {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: var(--bg4);
  opacity: 0.6;
  transition: var(--transition-fast);
}

.voice-user .ind.active {
  opacity: 1;
  background: var(--danger);
  color: #fff;
}

.voice-user .media {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
}

.voice-user .media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.voice-user.screen {
  grid-column: span 2;
}

.voice-user .ind.screen { display: none; }
.voice-user.screen .ind.screen { display: flex; opacity: 1; background: var(--success); color: #fff; }

.voice-user audio {
  display: none;
}

.voice-controls {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--bg1);
}

.vc-btn {
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  color: var(--text);
  font-weight: 700;
  border: 1px solid var(--border);
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.vc-btn:hover {
  background: var(--bg4);
  transform: translateY(-1px);
}

.vc-btn.active {
  background: var(--danger);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(255, 77, 109, 0.32);
}

.vc-btn.danger {
  background: var(--danger);
  color: #fff;
  border-color: transparent;
}

.vc-btn.danger:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

/* Member List Sidebar / Panel */
.member-sidebar,
.members-panel {
  width: 240px;
  min-width: 240px;
  background: var(--bg1);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px 12px;
}

.member-sidebar.hidden,
.members-panel.hidden {
  display: none;
}

.members-header {
  padding: 0 8px 14px 4px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.members-panel {
  padding: 16px 12px 16px 10px;
  box-sizing: border-box;
  width: 240px;
  min-width: 220px;
  max-width: 240px;
  overflow-x: hidden;
}

.members-panel .members-header {
  margin-right: -2px;
}

.member-category {
  color: var(--text3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 800;
  margin: 14px 0 6px;
  padding: 0 8px;
}

.member-category:first-child {
  margin-top: 0;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
  margin-bottom: 2px;
}

.member-item:hover {
  background: var(--bg3);
}

.member-item .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  position: relative;
  flex-shrink: 0;
}

.member-item .meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.member-item .name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text1);
}

.member-item .custom-status {
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Thread Panel */
.thread-panel {
  width: 340px;
  min-width: 340px;
  background: var(--bg1);
  border-left: 1px solid var(--border);
  display: none;
  flex-direction: column;
}

.thread-panel.active {
  display: flex;
}

.thread-panel-header {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 15px;
}

.thread-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.thread-message {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
}

.thread-message .thread-meta {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 4px;
}

/* Pinned Messages Panel */
.pinned-panel {
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  max-height: 180px;
  background: var(--bg1);
  border-bottom: 1px solid var(--border);
  display: none;
  flex-direction: column;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

.pinned-panel.active {
  display: flex;
}

.pinned-panel-header {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
}

.pinned-list {
  overflow-y: auto;
  padding: 0 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pinned-message {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition-fast);
}

.pinned-message:hover {
  background: var(--bg3);
}

/* Status indicator dot (shared) */
.status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2.5px solid var(--bg2);
  background: var(--status-offline);
}

.status-dot.online {
  background: var(--status-online);
  box-shadow: 0 0 8px var(--status-online);
}

.status-dot.away {
  background: var(--status-away);
}

.status-dot.dnd {
  background: var(--status-dnd);
  box-shadow: 0 0 8px var(--status-dnd);
}

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

/* Avatars with gradients */
.avatar {
  position: relative;
}

.avatar.gradient-1 { background: linear-gradient(135deg, #7c5cff, #00d2ff); }
.avatar.gradient-2 { background: linear-gradient(135deg, #ff62ba, #7c5cff); }
.avatar.gradient-3 { background: linear-gradient(135deg, #42f2a2, #00d2ff); }
.avatar.gradient-4 { background: linear-gradient(135deg, #ffcc42, #ff62ba); }
.avatar.gradient-5 { background: linear-gradient(135deg, #ff4d6d, #ffcc42); }

.avatar.premium-ring {
  box-shadow: 0 0 0 2px var(--bg2), 0 0 0 4px var(--premium);
}

.avatar.premium-ring::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--premium), var(--boost), var(--accent2), var(--premium));
  z-index: -1;
  animation: avatarGlow 3s linear infinite;
}

@keyframes avatarGlow {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* Tooltip */
.tooltip {
  position: absolute;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--bg4);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  border: 1px solid var(--border2);
  box-shadow: var(--shadow-sm);
}

.tooltip.active {
  opacity: 1;
  transform: translateY(0);
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--bg4);
}

.tooltip.top::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--bg4);
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal {
  width: 480px;
  max-width: 94%;
  max-height: 90vh;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  background: var(--bg2);
  box-shadow: var(--shadow), 0 0 60px rgba(124, 92, 255, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text2);
  font-size: 24px;
  line-height: 1;
  transition: var(--transition-fast);
}

.modal-close:hover {
  background: var(--danger);
  color: #fff;
}

.modal-body {
  padding: 22px;
  overflow-y: auto;
}

.modal-body input,
.modal-body select,
.modal-body textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  margin-bottom: 14px;
  transition: var(--transition-fast);
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  border-color: var(--accent);
  background: var(--bg1);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.12);
}

.modal-body textarea {
  min-height: 90px;
  resize: vertical;
}

.modal-body button {
  width: 100%;
}

.modal-body .row {
  display: flex;
  gap: 10px;
}

.modal-body .row input {
  flex: 1;
}

.modal-body .checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text2);
  font-size: 14px;
  margin-bottom: 16px;
}

.modal-body .checkbox-row input {
  width: auto;
  margin: 0;
}

.modal-body .modal-list {
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.settings-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  border-bottom: 2px solid transparent;
}
.settings-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.settings-panel { display: none; }
.settings-panel.active { display: block; }

.role-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}
.role-header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.role-name-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 10px;
}
.role-delete {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 16px;
}
.role-perms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
}
.perm-row {
  font-size: 12px;
  color: var(--text-muted);
}
.role-form {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  align-items: center;
}

.modal-body .modal-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  transition: var(--transition-fast);
}

.modal-body .modal-list-item:hover {
  background: var(--bg1);
  border-color: var(--border2);
}

.modal-body .modal-list-item .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
}

.modal-body .modal-list-item .meta {
  flex: 1;
}

.modal-body .modal-list-item .name {
  font-weight: 700;
  font-size: 14px;
}

.modal-body .modal-list-item .sub {
  font-size: 12px;
  color: var(--text3);
}

.modal-body .modal-list-item button {
  width: auto;
  padding: 7px 13px;
  font-size: 13px;
}

.modal-body .sub {
  color: var(--text2);
  font-size: 13px;
  line-height: 1.5;
}

/* Call popup */
.call-popup {
  display: none;
  position: fixed;
  bottom: 26px;
  right: 26px;
  width: 340px;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  box-shadow: var(--shadow), 0 0 40px rgba(124, 92, 255, 0.2);
  z-index: 110;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: var(--bg2);
  overflow: hidden;
}

.call-popup.active {
  display: flex;
  animation: popIn 0.35s ease;
}

.call-popup::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.08), transparent 50%, rgba(0, 210, 255, 0.06));
  pointer-events: none;
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.call-popup .call-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.call-popup .avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  animation: callPulse 1.6s ease-in-out infinite;
}

@keyframes callPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 92, 255, 0.4); }
  50% { box-shadow: 0 0 0 18px rgba(124, 92, 255, 0); }
}

.call-popup .name {
  font-weight: 700;
  font-size: 18px;
}

.call-popup .sub {
  color: var(--text2);
  font-size: 13px;
}

.call-popup .call-actions {
  display: flex;
  gap: 12px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.call-popup .call-actions button {
  flex: 1;
  min-width: 110px;
}

.call-popup .call-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  background: #000;
  opacity: 0;
  transition: opacity .25s ease;
}
.call-popup .call-video.active {
  opacity: 1;
}

.call-popup .call-actions button.active {
  background: var(--accent);
  color: #fff;
}

.call-popup .call-info,
.call-popup .call-actions {
  z-index: 2;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 8px;
}

.call-popup .call-info {
  margin-top: 12px;
}

/* Context Menu */
.context-menu {
  display: none;
  position: fixed;
  z-index: 120;
  min-width: 190px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  flex-direction: column;
  padding: 6px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.context-menu.active {
  display: flex;
  animation: ctxIn 0.12s ease;
}

@keyframes ctxIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.context-item {
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text1);
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
}

.context-item:hover {
  background: var(--accent);
  color: #fff;
}

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

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

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg2);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  box-shadow: var(--shadow-sm);
  z-index: 130;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transition: all 0.25s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  border-color: rgba(66, 242, 162, 0.4);
  color: var(--success);
  box-shadow: 0 0 20px rgba(66, 242, 162, 0.15);
}

.toast.error {
  border-color: rgba(255, 77, 109, 0.4);
  color: var(--danger);
  box-shadow: 0 0 20px rgba(255, 77, 109, 0.15);
}

.toast.info {
  border-color: rgba(0, 210, 255, 0.4);
  color: var(--info);
  box-shadow: 0 0 20px rgba(0, 210, 255, 0.15);
}

/* Emoji picker placeholder */
.server-dropdown {
  position: absolute;
  top: 56px;
  left: 10px;
  right: 10px;
  max-width: 260px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  z-index: 110;
  display: none;
  flex-direction: column;
  padding: 8px 6px;
  animation: dropdownIn 0.14s ease;
}

.server-dropdown.active {
  display: flex;
}

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

.server-dropdown-header {
  padding: 10px 12px 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.server-dropdown-section {
  display: flex;
  flex-direction: column;
}

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

.server-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text1);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.server-dropdown-item:hover {
  background: var(--accent);
  color: #fff;
}

.server-dropdown-item.boost {
  color: var(--accent2);
}

.server-dropdown-item.boost:hover {
  background: var(--accent2);
  color: #000;
}

.server-dropdown-item.invite {
  color: var(--success);
}

.server-dropdown-item.invite:hover {
  background: var(--success);
  color: #000;
}

.server-dropdown-item .dd-icon {
  width: 18px;
  display: inline-flex;
  justify-content: center;
}

.server-info {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: var(--transition-fast);
  flex: 0 1 auto;
  min-width: 0;
  max-width: calc(100% - 170px);
  color: var(--text);
}

.server-info #current-server-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
}

.server-info:not(.has-dropdown) {
  cursor: default;
  pointer-events: none;
}

.server-info:not(.has-dropdown):hover {
  background: transparent;
}

.server-info.has-dropdown:hover {
  background: var(--glass2);
}

.server-dropdown-chevron {
  font-size: 12px;
  color: var(--text3);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-top: 1px;
}

.server-info.active .server-dropdown-chevron {
  transform: rotate(180deg);
}

.server-info.active {
  background: var(--glass2);
}

/* Emoji picker placeholder */
.emoji-picker {
  position: absolute;
  bottom: 70px;
  left: 20px;
  width: 340px;
  height: 380px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 80;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.emoji-picker.active {
  display: flex;
  animation: pickerIn 0.18s ease;
}

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

.emoji-picker-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 6px;
}

.emoji-picker-tab {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  transition: var(--transition-fast);
}

.emoji-picker-tab:hover,
.emoji-picker-tab.active {
  background: var(--bg4);
  color: var(--text);
}

.emoji-picker-search {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.emoji-picker-search input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.emoji-picker-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

.emoji-picker-body .emoji {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.emoji-picker-body .emoji:hover {
  background: var(--bg4);
  transform: scale(1.1);
}

/* Loading skeletons */
.skeleton {
  background: linear-gradient(90deg, var(--bg2) 25%, var(--bg3) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
  border-radius: 8px;
  animation: skeleton 1.4s ease-in-out infinite;
}

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 12px;
  margin-bottom: 8px;
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.skeleton-row {
  display: flex;
  gap: 12px;
  padding: 12px;
}

.member-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}

.member-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.member-name {
  font-weight: 600;
  font-size: 14px;
}

.member-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.role-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

.role-assign {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  min-width: 120px;
}

.member-kick {
  background: none;
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 12px;
}

.avatar-sm {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.audit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
}

.audit-row {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}

.audit-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.audit-time {
  font-variant-numeric: tabular-nums;
}

.audit-actor {
  color: var(--accent);
  font-weight: 600;
}

.audit-action {
  font-size: 13px;
  font-weight: 600;
}

.audit-detail {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-all;
}

.search-panel {
  position: fixed;
  top: 64px;
  right: 18px;
  width: min(440px, calc(100vw - 36px));
  max-height: 520px;
  display: flex;
  flex-direction: column;
  z-index: 90;
  border-radius: 14px;
  padding: 12px;
}

.search-panel.hidden {
  display: none;
}

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

.search-header input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 14px;
}

.search-results {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-result {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
}

.search-result:hover {
  border-color: var(--accent);
}

.search-result .meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.search-result .snippet {
  font-size: 13px;
  color: var(--text);
  word-break: break-word;
}

.search-highlight {
  background: var(--accent-glow);
  border-radius: 3px;
  padding: 1px 2px;
  font-weight: 700;
}

.message.highlight {
  animation: highlightPulse 2.5s ease;
}

@keyframes highlightPulse {
  0% { background: transparent; }
  15% { background: var(--accent-glow); }
  100% { background: transparent; }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: var(--bg5);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bg6);
  background-clip: padding-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--bg5) transparent;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(124, 92, 255, 0.2); }
  50% { box-shadow: 0 0 40px rgba(124, 92, 255, 0.4); }
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1100px) {
  .home-sidebar {
    width: 240px;
    min-width: 240px;
  }

  .member-sidebar {
    width: 200px;
    min-width: 200px;
  }
}

@media (max-width: 900px) {
  .home-sidebar {
    display: none;
  }

  .server-sidebar {
    width: 68px;
    min-width: 68px;
  }

  .server-icon {
    width: 46px;
    height: 46px;
    font-size: 15px;
  }

  .channel-panel {
    width: 220px;
    min-width: 220px;
  }

  .voice-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    padding: 18px;
    gap: 14px;
  }

  .member-sidebar {
    display: none;
  }
}

@media (max-width: 720px) {
  .home-header {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 10px;
  }

  .home-tabs {
    order: 3;
    width: 100%;
    flex: auto;
  }

  .home-tabs .tab {
    flex: 1;
    text-align: center;
  }

  .btn-add-friend-header {
    order: 2;
  }
  .channel-panel {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    z-index: 90;
    transform: translateX(-100%);
  }

  .channel-panel.open {
    transform: translateX(0);
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.5);
  }

  .icon-btn.mobile-only {
    display: flex;
  }

  .server-sidebar {
    display: none;
  }

  .mobile-server-nav {
    display: flex;
  }

  .content {
    padding-top: 62px;
  }

  .modal {
    width: 96%;
  }

  .thread-panel {
    position: fixed;
    right: 0;
    top: 62px;
    bottom: 0;
    width: 100%;
    max-width: 360px;
    z-index: 85;
  }

  .member-sidebar {
    display: none;
  }
}

@media (max-width: 560px) {
  .auth-card {
    padding: 26px 22px;
  }

  .auth-card h1 {
    font-size: 22px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions button {
    width: 100%;
  }

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

  .voice-user .avatar {
    width: 60px;
    height: 60px;
    font-size: 20px;
  }

  .vc-btn {
    padding: 10px 14px;
    font-size: 13px;
  }

  .call-popup {
    width: calc(100% - 32px);
    right: 16px;
    bottom: 16px;
  }

  .chat-input {
    padding: 10px 14px;
  }

  .messages {
    padding: 14px;
  }

  .message .avatar {
    width: 36px;
    height: 36px;
    font-size: 12px;
  }

  .friend-item .avatar {
    width: 38px;
    height: 38px;
  }

  .content-header {
    padding: 18px 20px;
  }

  .content-header h2 {
    font-size: 20px;
  }

  .message-bubble,
  .dm-messages .message:not(.mine) .content,
  .dm-messages .message.mine .content {
    max-width: 90%;
  }

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

  .emoji-picker {
    width: calc(100% - 40px);
    left: 20px;
  }
}

@media (max-width: 360px) {
  .mobile-server-icon {
    width: 40px;
    height: 40px;
    font-size: 13px;
  }
}

/* Hilfsklassen */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* ================= DISCORD-INSPIRED EXTRAS ================= */

/* Channel topic display */
.channel-topic {
  font-size: 12px;
  color: var(--text3);
  margin-top: 4px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-topic-bar {
  font-size: 12px;
  color: var(--text3);
  margin-left: 8px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.channel-topic-bar.hidden {
  display: none;
}

/* Reply preview bar below messages */
.reply-preview {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--bg1);
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text2);
}

.reply-preview.active {
  display: flex;
}

.reply-preview .reply-label {
  color: var(--accent);
  font-weight: 700;
}

.reply-preview .reply-content {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reply-preview .reply-close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg3);
  color: var(--text2);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reply-preview .reply-close:hover {
  background: var(--danger);
  color: #fff;
}

/* Desktop-only helper */
.desktop-only {
  display: flex;
}

@media (max-width: 900px) {
  .desktop-only {
    display: none !important;
  }
}

/* Search overlay modal */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  z-index: 110;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.search-overlay.active {
  display: flex;
  opacity: 1;
}

.search-modal {
  width: 640px;
  max-width: 94%;
  max-height: 80vh;
  border-radius: var(--radius);
  background: var(--bg2);
  border: 1px solid var(--border2);
  box-shadow: var(--shadow), 0 0 60px rgba(124, 92, 255, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.search-overlay.active .search-modal {
  transform: translateY(0) scale(1);
}

.search-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-modal-header input {
  flex: 1;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}

.search-modal-header input:focus {
  border-color: var(--accent);
  background: var(--bg1);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.12);
}

.search-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-result-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition-fast);
}

.search-result-item:hover {
  background: var(--bg1);
  border-color: var(--border2);
}

.search-result-item .body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-result-item .meta {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 13px;
}

.search-result-item .name {
  font-weight: 700;
  color: var(--text1);
}

.search-result-item .where {
  color: var(--text3);
  font-size: 12px;
}

.search-result-item .snippet {
  color: var(--text2);
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.search-empty {
  text-align: center;
  color: var(--text3);
  padding: 40px 0;
  font-size: 14px;
}

/* Voice settings panel inside modal */
.voice-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.voice-settings-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.voice-settings-row label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.voice-settings-row select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.voice-meter {
  height: 8px;
  border-radius: 4px;
  background: var(--bg4);
  overflow: hidden;
  margin-top: 4px;
}

.voice-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.08s ease;
}

.voice-keybind {
  display: flex;
  align-items: center;
  gap: 10px;
}

.voice-keybind .key {
  min-width: 70px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg4);
  border: 1px solid var(--border2);
  text-align: center;
  font-weight: 700;
  color: var(--text1);
}

.voice-keybind button {
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

/* Pinned / unread badge on icons */
.pinned-count,
.unread-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg1);
}

/* Thread count pill in message hover */
.thread-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--bg3);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  transition: var(--transition-fast);
}

.thread-count:hover {
  background: var(--bg4);
  color: var(--text);
}

/* Context menu emoji sub-menu */
.context-emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  padding: 8px;
  max-width: 220px;
}

.context-emoji-grid .emoji {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border-radius: 6px;
  cursor: pointer;
}

.context-emoji-grid .emoji:hover {
  background: var(--bg4);
  transform: scale(1.12);
}

/* Profile / settings cards */
.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding-bottom: 16px;
}

.profile-card .avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  font-size: 32px;
}

.profile-card .name {
  font-size: 20px;
  font-weight: 800;
}

.profile-card .status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text2);
}

.profile-card .actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.profile-card .actions button {
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

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

.settings-section h4 {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

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

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

.settings-row label {
  font-size: 14px;
  color: var(--text1);
}

.settings-row input[type="checkbox"] {
  width: 42px;
  height: 24px;
  appearance: none;
  border-radius: 12px;
  background: var(--bg4);
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}

.settings-row input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.settings-row input[type="checkbox"]:checked {
  background: var(--accent);
}

.settings-row input[type="checkbox"]:checked::after {
  transform: translateX(18px);
}

/* Keyboard shortcuts modal */
.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shortcut-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.shortcut-row .keys {
  display: flex;
  gap: 6px;
  align-items: center;
}

.shortcut-row .key {
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  font-size: 12px;
  font-weight: 700;
  color: var(--text1);
  font-family: var(--mono);
}

.shortcut-row .desc {
  font-size: 14px;
  color: var(--text2);
}

/* Notification permission toast */
.notification-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 320px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--bg2);
  border: 1px solid var(--border2);
  box-shadow: var(--shadow);
  z-index: 140;
  display: none;
  flex-direction: column;
  gap: 12px;
}

.notification-toast.active {
  display: flex;
  animation: popIn 0.3s ease;
}

.notification-toast span {
  font-size: 14px;
  color: var(--text1);
}

.notification-toast .actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.notification-toast .actions button {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

/* Upload progress bar */
.upload-progress {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
  z-index: 95;
  display: none;
}

.upload-progress.active {
  display: block;
}

.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.2s ease;
}

/* Sound toggle indicator */
.sound-enabled {
  color: var(--success);
}

.sound-disabled {
  color: var(--text4);
}
