:root {
  --primary: #00A884;
  --primary-dark: #008069;
  --primary-light: #D9FDD3;
  --accent: #25D366;
  --accent-glow: rgba(37,211,102,0.15);
  --bg-primary: #111B21;
  --bg-secondary: #1f2a32;
  --bg-tertiary: #2a3940;
  --bg-card: #1a2630;
  --bg-elevated: #23313a;
  --chat-bg: #0B141A;
  --chat-self: #005C4B;
  --chat-other: #202C33;
  --text-primary: #E9EDEF;
  --text-secondary: #8696A0;
  --text-muted: #667781;
  --border-color: rgba(255,255,255,0.06);
  --border-light: #313D45;
  --danger: #EF4444;
  --success: #25D366;
  --shadow: 0 8px 32px rgba(0,0,0,.4);
  --shadow-lg: 0 24px 80px rgba(0,0,0,.5);
  --radius: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --transition: .2s ease;
}

[data-theme="light"] {
  --bg-primary: #111B21;
  --bg-secondary: #1f2a32;
  --bg-tertiary: #2a3940;
  --bg-card: #1a2630;
  --bg-elevated: #23313a;
  --chat-bg: #0B141A;
  --chat-self: #005C4B;
  --chat-other: #202C33;
  --text-primary: #E9EDEF;
  --text-secondary: #8696A0;
  --text-muted: #667781;
  --border-color: rgba(255,255,255,0.06);
  --border-light: #313D45;
}

html { scroll-behavior: smooth; }

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

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* APP CONTAINER */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
  max-width: 1600px;
  margin: 0 auto;
  background: var(--bg-primary);
}

/* SIDEBAR */
.app-sidebar {
  width: 420px;
  min-width: 320px;
  flex-shrink: 0;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.sidebar-header {
  background: var(--bg-secondary);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header .user-info h6 { color: var(--text-primary); font-weight: 600; font-size: 15px; }
.sidebar-header .user-info small { color: var(--text-muted); font-size: 12px; }

.sidebar-actions { display: flex; align-items: center; gap: 2px; }

.sidebar-search {
  padding: 8px 12px;
  background: var(--bg-primary);
}

.search-box { position: relative; display: flex; align-items: center; width: 100%; }

.search-box i {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  z-index: 1;
  font-size: 14px;
}

.search-box input {
  padding-left: 36px;
  border-radius: 10px;
  background: var(--bg-secondary);
  border: 1px solid transparent;
  font-size: 14px;
  height: 40px;
  color: var(--text-primary);
  width: 100%;
  transition: var(--transition);
}

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

.search-box input:focus {
  outline: none;
  background: var(--bg-primary);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.sidebar-tabs {
  display: flex;
  padding: 4px 12px 0;
  gap: 4px;
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  cursor: pointer;
  font-family: var(--font);
}

.tab-btn:hover { color: var(--text-primary); }

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.sidebar-chats {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* CHAT ITEM */
.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border-color);
}

.chat-item:hover { background: var(--bg-secondary); }

.chat-item.active { background: var(--bg-tertiary); }

.chat-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.chat-avatar img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.chat-avatar .status-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
}

.chat-avatar .status-dot.online { background: var(--accent); box-shadow: 0 0 6px rgba(37,211,102,.5); }
.chat-avatar .status-dot.offline { background: #667781; }

.group-avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
}

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

.chat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.chat-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: 8px;
}

.chat-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-preview {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.chat-item.unread .chat-name { color: var(--text-primary); }
.chat-item.unread .chat-preview { color: var(--text-primary); font-weight: 500; }

.unread-badge {
  background: var(--accent);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  flex-shrink: 0;
}

/* MAIN PANEL */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--chat-bg);
  position: relative;
}

/* WELCOME */
.welcome-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--chat-bg);
  position: relative;
}

.welcome-screen::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -5%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 65%);
  pointer-events: none;
}

.welcome-content { max-width: 460px; position: relative; z-index: 1; }

.welcome-icon i {
  font-size: 72px;
  color: var(--accent);
  opacity: .3;
}

.welcome-content h2 { font-weight: 700; color: var(--text-primary); font-size: 26px; }
.welcome-content p { color: var(--text-secondary); font-size: 14px; }

.welcome-features { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

.welcome-features .feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 14px;
}

.welcome-features .feature-item i { width: 20px; text-align: center; font-size: 16px; }

/* CHAT PANEL */
.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.chat-header {
  background: rgba(31,42,50,.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  z-index: 5;
  border-bottom: 1px solid var(--border-color);
}

.chat-header-info { flex: 1; min-width: 0; margin-left: 12px; }
.chat-header-info h6 { font-weight: 600; font-size: 16px; color: var(--text-primary); }
.chat-header-info small { font-size: 12px; color: var(--text-secondary); }
.chat-header-info small.typing-text { color: var(--accent); }

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

/* CHAT MESSAGES */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 40px;
  background: var(--chat-bg);
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='1' fill='%23fff'/%3E%3C/g%3E%3C/svg%3E");
}

.messages-container { display: flex; flex-direction: column; gap: 2px; }

/* LOADING */
#loadingMessages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px;
  color: var(--text-muted);
  font-size: 14px;
}

#loadingMessages .spinner-border { width: 18px; height: 18px; }

/* MESSAGE WRAPPER */
.message-wrapper {
  display: flex;
  margin-bottom: 3px;
  max-width: 70%;
  animation: msgSlideIn .2s ease-out;
}

.message-wrapper.mine { align-self: flex-end; }
.message-wrapper.theirs { align-self: flex-start; }

.message-bubble {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  position: relative;
  cursor: pointer;
  transition: opacity var(--transition);
}

.message-wrapper.mine .message-bubble {
  background: var(--chat-self);
  color: #E9EDEF;
  border-top-right-radius: 2px;
}

.message-wrapper.theirs .message-bubble {
  background: var(--chat-other);
  color: #E9EDEF;
  border-top-left-radius: 2px;
}

.message-time {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: rgba(233,237,239,.6);
  margin-top: 3px;
  justify-content: flex-end;
}

.message-wrapper.mine .message-time { color: rgba(233,237,239,.7); }

.message-status { font-size: 12px; }
.message-status.read { color: #53bdeb; }

/* MESSAGE IMAGE */
.message-image {
  max-width: 280px;
  max-height: 300px;
  border-radius: 6px;
  cursor: pointer;
  display: block;
  margin-bottom: 4px;
}

.message-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition);
}

.message-file i { font-size: 28px; }
.message-file strong { font-size: 13px; }
.message-file small { font-size: 11px; opacity: .7; }

/* REACTIONS */
.message-reactions {
  display: flex;
  gap: 2px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.reaction-badge {
  background: rgba(0,0,0,.3);
  border-radius: 12px;
  padding: 2px 6px;
  font-size: 13px;
  line-height: 1;
}

/* DATE SEPARATOR */
.date-separator {
  text-align: center;
  margin: 12px 0;
}

.date-separator span {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 4px 14px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
}

/* CHAT INPUT */
.chat-input {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 8px 16px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.input-toolbar { margin-bottom: 6px; }

.reply-bar {
  display: flex;
  align-items: center;
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 8px 12px;
  border-left: 3px solid var(--accent);
}

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

.reply-label {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.reply-text {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-field { flex: 1; }

.input-field input {
  width: 100%;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font);
}

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

.input-field input:focus { outline: none; }

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-size: 18px;
  flex-shrink: 0;
}

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

.btn-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-size: 16px;
  flex-shrink: 0;
}

.btn-send:hover { background: #1fa85a; transform: scale(1.05); box-shadow: 0 4px 16px var(--accent-glow); }
.btn-send:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }

/* ATTACHMENT MENU */
.attachment-menu {
  padding: 12px 0 4px;
}

.attachment-options {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.attachment-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font);
  transition: var(--transition);
}

.attachment-option:hover { color: var(--text-primary); }

.attachment-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  transition: var(--transition);
}

.attachment-option:hover .attachment-icon { transform: scale(1.08); }

/* TOAST */
.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* BTN BACK (profile) */
.btn-back {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
  background: none;
  border: none;
  transition: background var(--transition);
  font-size: 18px;
}

.btn-back:hover { background: var(--bg-tertiary); }

/* EMPTY STATE */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-state h5 { color: var(--text-primary); margin-bottom: 4px; font-weight: 600; }
.empty-state p { font-size: 14px; color: var(--text-muted); margin-bottom: 16px; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* AVATAR */
.avatar {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  cursor: pointer;
}

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

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

.avatar .status-dot.online { background: var(--accent); }
.avatar .status-dot.offline { background: #667781; }

/* AUTH */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding: 100px 20px;
  position: relative;
  overflow-y: auto;
}

.auth-container::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 65%);
  pointer-events: none;
}

.auth-container::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -10%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,168,132,0.06) 0%, transparent 65%);
  pointer-events: none;
}

.auth-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  position: relative;
  z-index: 1;
  animation: authFadeIn .5s ease-out;
}

.auth-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  padding: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 32px;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.auth-title { font-weight: 700; color: var(--text-primary); font-size: 26px; }
.auth-subtitle { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }

.auth-card .form-label { color: var(--text-secondary); font-weight: 500; font-size: 13px; margin-bottom: 6px; }

.auth-card .form-control {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  transition: var(--transition);
  width: 100%;
}

.auth-card .form-control:focus {
  background: var(--bg-tertiary);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  color: var(--text-primary);
  outline: none;
}

.auth-card .form-control::placeholder { color: var(--text-muted); }

.auth-card .input-group-text {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-right: none;
  border-radius: 10px 0 0 10px;
  color: var(--text-secondary);
  padding: 11px 14px;
}

.auth-card .input-group .form-control { border-radius: 0 10px 10px 0; }

.auth-card .input-group .btn-outline-secondary {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-left: none;
  border-radius: 0 10px 10px 0;
  color: var(--text-muted);
  padding: 11px 14px;
  cursor: pointer;
}

.auth-card .input-group .btn-outline-secondary:hover { color: var(--text-primary); }

.auth-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: color var(--transition);
}

.auth-link:hover { color: var(--primary); text-decoration: underline; }

.auth-btn {
  background: var(--primary);
  border: none;
  padding: 13px;
  font-weight: 600;
  border-radius: var(--radius);
  font-size: 15px;
  transition: all .25s;
  position: relative;
  overflow: hidden;
  color: #fff;
  width: 100%;
  cursor: pointer;
  font-family: var(--font);
}

.auth-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,168,132,0.3);
}

.auth-btn:active { transform: translateY(0); }

.auth-card .form-check-label { color: var(--text-secondary); font-size: 14px; }
.auth-card .form-check-input { background: var(--bg-tertiary); border-color: var(--border-light); }
.auth-card .form-check-input:checked { background: var(--accent); border-color: var(--accent); }

.auth-card .alert { border-radius: var(--radius); border: none; font-size: 13px; padding: 12px 16px; }
.auth-card .alert-danger { background: rgba(239,68,68,0.12); color: #fca5a5; }
.auth-card .alert-success { background: rgba(37,211,102,0.12); color: #86efac; }

.password-strength .progress { background: var(--bg-tertiary); border-radius: 10px; height: 4px; }

.auth-footer { color: var(--text-secondary); font-size: 14px; margin-top: 24px; text-align: center; }

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

/* PROFILE */
.profile-container {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-primary);
}

.profile-header {
  background: var(--bg-secondary);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

.profile-header h4 { font-weight: 600; font-size: 17px; color: var(--text-primary); }

.profile-content { padding: 24px 16px; }

.profile-pic-section { text-align: center; padding: 24px 0; }

.profile-pic-wrapper {
  position: relative;
  width: 120px;
  margin: 0 auto;
}

.profile-pic-lg {
  width: 120px; height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.profile-pic-edit {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  border: 2px solid var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}

.profile-pic-edit:hover { transform: scale(1.1); }

.section-title {
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 16px;
}

.profile-content .form-label { color: var(--text-secondary); font-weight: 500; font-size: 13px; }

.profile-content .form-control,
.profile-content .form-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  width: 100%;
}

.profile-content .form-control:focus,
.profile-content .form-select:focus {
  background: var(--bg-secondary);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  color: var(--text-primary);
  outline: none;
}

.profile-content .form-control:disabled { opacity: .5; }

.profile-content .form-check-label { color: var(--text-secondary); }
.profile-content .form-check-input { background: var(--bg-tertiary); border-color: var(--border-light); }
.profile-content .form-check-input:checked { background: var(--accent); border-color: var(--accent); }
.profile-content .text-muted { color: var(--text-muted) !important; }

.profile-content .alert {
  border-radius: var(--radius);
  border: none;
  font-size: 13px;
  padding: 12px 16px;
}

.profile-content .alert-success { background: rgba(37,211,102,0.12); color: #86efac; }
.profile-content .alert-danger { background: rgba(239,68,68,0.12); color: #fca5a5; }

/* LIST GROUP (settings/contacts) */
.profile-content .list-group { display: flex; flex-direction: column; gap: 8px; }

.profile-content .list-group-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius) !important;
  padding: 14px 16px;
  transition: background var(--transition);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-content .list-group-item:hover { background: var(--bg-tertiary); cursor: pointer; }
.profile-content .list-group-item strong { color: var(--text-primary); }
.profile-content .list-group-item small { color: var(--text-secondary); }
.profile-content .list-group-item .text-danger { color: #f87171 !important; }

/* MODAL */
.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: 16px 20px;
}

.modal-header .modal-title { color: var(--text-primary); font-weight: 600; }
.modal-header .btn-close { filter: invert(1); opacity: .7; }
.modal-body { padding: 20px; }
.modal-backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }

/* BTN PRIMARY (custom) */
.btn-primary-custom {
  background: var(--primary);
  border: none;
  color: #fff;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all .25s;
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary-custom:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 16px var(--accent-glow); }

/* ANIMATIONS */
@keyframes msgSlideIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

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

/* RESPONSIVE */
@media (max-width: 768px) {
  .app-sidebar {
    width: 100%;
    min-width: 0;
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    transition: transform .3s ease;
  }

  .app-sidebar.hidden { transform: translateX(-100%); }

  .chat-messages { padding: 16px; }

  .message-wrapper { max-width: 85%; }
}

@media (min-width: 769px) { .app-sidebar { width: 380px; } }

@media (min-width: 1400px) {
  .app-sidebar { width: 420px; }
  .chat-messages { padding: 20px 60px; }
}

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; border-radius: 16px; }
  .chat-messages { padding: 12px; }
  .message-wrapper { max-width: 88%; }
  .profile-pic-lg { width: 90px; height: 90px; }
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}