/* === THEME VARIABLES === */
:root, [data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-hover: #2d3a4f;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: #2d3748;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.3);
  --radius: 8px;
  --code-bg: rgba(255,255,255,0.08);
  --link-preview-bg: #1a2332;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e2e8f0;
  --bg-hover: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  --code-bg: rgba(0,0,0,0.06);
  --link-preview-bg: #f1f5f9;
}

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

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

/* === LOGIN === */
.login-container { display: flex; align-items: center; justify-content: center; height: 100vh; background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%); }
.login-box { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 16px; padding: 48px; width: 400px; box-shadow: var(--shadow); }
.login-logo { display: block; width: 80px; height: 80px; object-fit: contain; margin: 0 auto 16px; }
.login-box h1 { font-size: 28px; margin-bottom: 8px; text-align: center; }
.login-box p { color: var(--text-secondary); text-align: center; margin-bottom: 32px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; color: var(--text-secondary); margin-bottom: 6px; }
.form-group input, .form-group select { width: 100%; padding: 12px 16px; background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-primary); font-size: 15px; outline: none; transition: border-color 0.2s; }
.form-group input:focus { border-color: var(--accent); }
.btn { padding: 12px 24px; border: none; border-radius: var(--radius); font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-primary { width: 100%; background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.login-error { color: var(--danger); font-size: 14px; text-align: center; margin-top: 12px; min-height: 20px; }

/* === LAYOUT === */
.app { display: flex; height: 100vh; }

/* === SIDEBAR === */
.sidebar { width: 280px; background: var(--bg-secondary); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sidebar-logo { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.sidebar-title { font-size: 15px; font-weight: 700; white-space: nowrap; }
.sidebar-header-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.btn-icon { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; padding: 4px 8px; border-radius: 6px; transition: all 0.15s; }
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-section { padding: 16px 12px 8px; }
.sidebar-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); padding: 0 8px; margin-bottom: 4px; display: flex; align-items: center; justify-content: space-between; }
.sidebar-section-title button { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 2px; }
.sidebar-section-title button:hover { color: var(--text-primary); }
.channel-list, .user-list { list-style: none; overflow-y: auto; }
.channel-item, .user-item { display: flex; align-items: center; padding: 8px 16px; border-radius: 6px; cursor: pointer; color: var(--text-secondary); font-size: 14px; margin: 1px 4px; transition: background 0.15s; }
.channel-item:hover, .user-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.channel-item.active, .user-item.active { background: var(--accent); color: white; }
.channel-item .hash { margin-right: 8px; font-weight: 700; opacity: 0.6; }
.user-item .status-dot { width: 8px; height: 8px; border-radius: 50%; margin-right: 10px; flex-shrink: 0; }
.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--text-muted); }
.status-dot.away { background: var(--warning); }
.status-dot.busy { background: var(--danger); }

.sidebar-credit { padding: 6px 16px 10px; text-align: center; font-size: 11px; color: var(--text-muted); }
.sidebar-credit a { color: var(--accent); text-decoration: none; }
.sidebar-credit a:hover { text-decoration: underline; }
.sidebar-footer { margin-top: auto; padding: 12px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.sidebar-footer .user-info { flex: 1; min-width: 0; }
.sidebar-footer .user-name { font-size: 14px; font-weight: 600; }

/* === STATUS PICKER === */
.status-picker { position: relative; }
.status-picker-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: 1px solid transparent; border-radius: 6px;
  color: var(--text-muted); font-size: 12px; padding: 3px 8px;
  cursor: pointer; transition: all 0.15s;
}
.status-picker-btn:hover { background: var(--bg-hover); border-color: var(--border); }
.status-picker-arrow { font-size: 8px; opacity: 0.5; transition: transform 0.2s; }
.status-picker-dropdown.open + .status-picker-btn .status-picker-arrow { transform: rotate(180deg); }
.status-dot-inline {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block;
}
.status-dot-inline.online { background: var(--success); box-shadow: 0 0 4px var(--success); }
.status-dot-inline.away { background: var(--warning); box-shadow: 0 0 4px var(--warning); }
.status-dot-inline.busy { background: var(--danger); box-shadow: 0 0 4px var(--danger); }
.status-dot-inline.offline { background: var(--text-muted); }
.status-picker-dropdown {
  position: absolute; bottom: calc(100% + 6px); left: 0;
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px; min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  opacity: 0; visibility: hidden; transform: translateY(6px) scale(0.96);
  transition: all 0.15s ease;
  z-index: 100;
}
.status-picker-dropdown.open {
  opacity: 1; visibility: visible; transform: translateY(0) scale(1);
}
.status-picker-option {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 7px; cursor: pointer;
  font-size: 13px; color: var(--text-primary);
  transition: background 0.1s;
}
.status-picker-option:hover { background: var(--bg-hover); }
.status-picker-option.active { background: var(--bg-hover); font-weight: 600; }
.status-check { margin-left: auto; color: var(--accent); font-size: 14px; }

.btn-logout, .btn-settings { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; padding: 4px; }
.btn-logout:hover { color: var(--danger); }
.btn-settings:hover { color: var(--text-primary); }

/* === CHAT AREA === */
.chat-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-header { padding: 16px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.chat-header h3 { font-size: 17px; font-weight: 700; }
.chat-header .description { color: var(--text-muted); font-size: 13px; }
.header-status { font-size: 12px; font-weight: 400; }
.header-status.online { color: var(--success); }
.header-status.away { color: var(--warning); }
.header-status.busy { color: var(--danger); }
.header-status.offline { color: var(--text-muted); }
.messages-container { flex: 1; overflow-y: auto; padding: 16px 24px; display: flex; flex-direction: column; gap: 4px; }

/* === MESSAGE === */
.message { display: flex; gap: 12px; padding: 8px 4px; border-radius: var(--radius); position: relative; }
.message:hover { background: var(--bg-hover); }
.message .avatar, .message .avatar-img { margin-top: 2px; }
.message-content { flex: 1; min-width: 0; }
.message-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.message-author { font-weight: 700; font-size: 14px; }
.message-time { font-size: 12px; color: var(--text-muted); }
.message-text { font-size: 14px; line-height: 1.5; color: var(--text-secondary); word-wrap: break-word; }

/* === REACT BUTTON === */
.btn-react { visibility: hidden; background: none; border: none; cursor: pointer; font-size: 14px; padding: 0 4px; opacity: 0; margin-left: auto; transition: opacity 0.1s; }
.btn-react:hover { opacity: 1; }
.message:hover .btn-react { visibility: visible; opacity: 0.5; }

/* === EMOJI PICKER === */
.emoji-picker { position: absolute; top: -4px; right: 8px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 10px; padding: 6px; display: flex; gap: 2px; z-index: 20; box-shadow: var(--shadow); }
.emoji-pick-btn { background: none; border: none; font-size: 20px; cursor: pointer; padding: 4px 6px; border-radius: 6px; transition: background 0.1s; }
.emoji-pick-btn:hover { background: var(--bg-hover); }

/* === REACTIONS === */
.msg-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.reaction-chip { background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 12px; padding: 2px 8px; font-size: 13px; cursor: pointer; transition: all 0.15s; }
.reaction-chip:hover { border-color: var(--accent); }
.reaction-chip.mine { background: rgba(59,130,246,0.15); border-color: var(--accent); }
.reaction-add-btn { background: none; border: 1px dashed var(--border); border-radius: 12px; padding: 2px 8px; font-size: 13px; cursor: pointer; color: var(--text-muted); }
.reaction-add-btn:hover { border-color: var(--accent); color: var(--text-primary); }

/* === READ RECEIPTS === */
.read-check { font-size: 11px; color: var(--text-muted); margin-left: 4px; }
.read-check.read { color: var(--accent); }
.read-receipts { min-height: 0; }

/* === LINK PREVIEW === */
.link-preview { display: flex; gap: 12px; background: var(--link-preview-bg); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 12px; margin-top: 8px; max-width: 450px; }
.link-preview.loading { color: var(--text-muted); font-size: 13px; font-style: italic; }
.link-preview-image { width: 80px; height: 80px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.link-preview-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.link-preview-site { font-size: 11px; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }
.link-preview-title { font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-preview-title:hover { text-decoration: underline; }
.link-preview-desc { font-size: 13px; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* === CODE BLOCKS === */
.code-block { background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; margin: 8px 0; overflow-x: auto; font-family: 'SF Mono', Monaco, Consolas, monospace; font-size: 13px; line-height: 1.5; color: var(--text-primary); white-space: pre; }
.code-block code { background: none; padding: 0; font-size: inherit; }
.inline-code { background: var(--code-bg); padding: 2px 6px; border-radius: 4px; font-size: 13px; font-family: 'SF Mono', Monaco, Consolas, monospace; }

/* === MSG LINK === */
.msg-link { color: var(--accent); text-decoration: none; }
.msg-link:hover { text-decoration: underline; }

/* === TYPING === */
.typing-indicator { padding: 4px 24px; font-size: 13px; color: var(--text-muted); min-height: 24px; font-style: italic; }

/* === INPUT === */
.chat-input-area { padding: 16px 24px; border-top: 1px solid var(--border); }
.chat-input-wrapper { display: flex; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; transition: border-color 0.2s; position: relative; }
.file-preview[style*="flex"] + .chat-input-wrapper { border-radius: 0 0 12px 12px; }
.chat-input-wrapper:focus-within { border-color: var(--accent); }
.chat-input { flex: 1; padding: 14px 18px; background: transparent; border: none; color: var(--text-primary); font-size: 15px; outline: none; font-family: inherit; }
.chat-input::placeholder { color: var(--text-muted); }
.btn-send { padding: 14px 20px; background: none; border: none; color: var(--accent); cursor: pointer; font-size: 20px; transition: color 0.2s; }
.btn-send:hover { color: var(--accent-hover); }

/* === INPUT EMOJI PICKER === */
.input-emoji-wrap { position: relative; display: flex; align-items: center; }
.btn-emoji-toggle { background: none; border: none; font-size: 20px; cursor: pointer; padding: 0 10px; opacity: 0.5; transition: opacity 0.15s; }
.btn-emoji-toggle:hover { opacity: 1; }
.input-emoji-picker {
  position: absolute; bottom: calc(100% + 12px); right: -20px;
  width: 340px; background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  opacity: 0; visibility: hidden; transform: translateY(6px) scale(0.96);
  transition: all 0.15s ease; z-index: 100;
  display: flex; flex-direction: column; max-height: 340px;
}
.input-emoji-picker.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.iep-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 4px 4px 0; gap: 2px; flex-shrink: 0; }
.iep-tab { background: none; border: none; border-bottom: 2px solid transparent; font-size: 18px; padding: 6px 8px; cursor: pointer; border-radius: 6px 6px 0 0; transition: all 0.1s; }
.iep-tab:hover { background: var(--bg-hover); }
.iep-tab.active { border-bottom-color: var(--accent); background: var(--bg-hover); }
.iep-panel { display: none; overflow-y: auto; padding: 8px; flex: 1; }
.iep-panel.active { display: block; }
.iep-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.iep-emoji { background: none; border: none; font-size: 22px; padding: 6px; cursor: pointer; border-radius: 6px; transition: background 0.1s; line-height: 1; }
.iep-emoji:hover { background: var(--bg-hover); }

/* === EMPTY STATE === */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--text-muted); }
.empty-state .icon { font-size: 64px; margin-bottom: 16px; opacity: 0.3; }
.empty-state h3 { font-size: 20px; margin-bottom: 8px; color: var(--text-secondary); }

/* === MODAL === */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 16px; padding: 32px; width: 420px; box-shadow: var(--shadow); }
.modal h3 { font-size: 20px; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); }
.btn-secondary:hover { background: var(--bg-hover); }

/* === BADGES === */
.badge { font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 700; text-transform: uppercase; }
.badge-admin { background: var(--danger); color: white; }
.unread-badge { background: var(--accent); color: white; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-left: auto; padding: 0 6px; }

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

/* === DATE SEPARATOR === */
.date-separator { display: flex; align-items: center; gap: 16px; padding: 12px 0; color: var(--text-muted); font-size: 12px; font-weight: 600; }
.date-separator::before, .date-separator::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .sidebar { width: 100%; position: fixed; z-index: 50; transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .mobile-header { display: flex !important; }
}
.mobile-header { display: none; padding: 12px; border-bottom: 1px solid var(--border); }
.btn-menu { background: none; border: none; color: var(--text-primary); font-size: 24px; cursor: pointer; }

/* === AVATAR IMAGE === */
.avatar-img { border-radius: 50%; object-fit: cover; }

/* === PROFILE MODAL === */
.profile-avatar-section { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.profile-avatar-preview { flex-shrink: 0; }
.profile-avatar-preview .avatar, .profile-avatar-preview .avatar-img { width: 80px !important; height: 80px !important; font-size: 30px !important; }
.profile-avatar-actions { display: flex; flex-direction: column; gap: 8px; }
.profile-message { font-size: 14px; min-height: 20px; margin-top: 8px; text-align: center; }
.profile-message.error { color: var(--danger); }
.profile-message.success { color: var(--success); }

/* === USER LIST AVATAR === */
.user-item-avatar-wrap { position: relative; margin-right: 10px; flex-shrink: 0; }
.user-item-avatar-wrap .avatar, .user-item-avatar-wrap .avatar-img { width: 24px !important; height: 24px !important; font-size: 10px !important; }
.status-dot-mini { position: absolute; bottom: -2px; right: -3px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bg-secondary); }
.status-dot-mini.online { background: var(--success); box-shadow: 0 0 5px var(--success); }
.status-dot-mini.offline { background: var(--text-muted); }
.status-dot-mini.away { background: var(--warning); box-shadow: 0 0 5px var(--warning); }
.status-dot-mini.busy { background: var(--danger); box-shadow: 0 0 5px var(--danger); }
.user-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-item.has-unread { color: var(--text-primary); font-weight: 600; }

/* === DELETE CHANNEL === */
.btn-delete-channel { display: none; margin-left: auto; background: none; border: none; color: var(--text-muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; flex-shrink: 0; }
.btn-delete-channel:hover { color: var(--danger); }
.channel-item:hover .btn-delete-channel { display: block; }
.channel-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* === ADMIN PANEL === */
.modal-wide { width: 560px; max-height: 80vh; display: flex; flex-direction: column; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.admin-header h3 { margin-bottom: 0; }
.admin-user-list { overflow-y: auto; max-height: 400px; border: 1px solid var(--border); border-radius: var(--radius); }
.admin-user-row { display: flex; align-items: center; padding: 12px 16px; gap: 12px; border-bottom: 1px solid var(--border); transition: background 0.15s; }
.admin-user-row:last-child { border-bottom: none; }
.admin-user-row:hover { background: var(--bg-hover); }
.admin-user-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.admin-user-name { font-weight: 600; font-size: 14px; }
.admin-user-username { font-size: 12px; color: var(--text-muted); }
.admin-user-status { flex-shrink: 0; }
.admin-user-status .status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.admin-user-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }

/* === GROUPS === */
.group-list { list-style: none; overflow-y: auto; }
.member-select-list { max-height: 200px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
.member-select-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.member-select-item:hover { background: var(--bg-hover); }
.member-select-item input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.member-select-avatar { flex-shrink: 0; }
.group-member-list { list-style: none; }
.group-member-item { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.group-member-item:last-child { border-bottom: none; }
.group-member-name { flex: 1; font-size: 14px; }
.badge-creator { font-size: 10px; padding: 2px 8px; border-radius: 10px; background: var(--accent); color: white; font-weight: 600; }
.btn-remove-member { padding: 2px 8px !important; font-size: 14px !important; }
.group-add-member { display: flex; gap: 8px; align-items: center; }
.group-add-member select { flex: 1; padding: 8px 12px; background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-primary); font-size: 14px; }
.btn-group-info { margin-left: auto; font-size: 20px !important; }

/* === FILE ATTACHMENT === */
.btn-attach { display: flex; align-items: center; justify-content: center; padding: 0 14px; font-size: 20px; color: var(--text-muted); cursor: pointer; transition: color 0.2s; flex-shrink: 0; }
.btn-attach:hover { color: var(--text-primary); }

/* === FILE PREVIEW === */
.file-preview { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px; background: var(--bg-secondary); border: 1px solid var(--border); border-bottom: none; border-radius: 12px 12px 0 0; position: relative; align-items: center; }
.file-preview-item { display: flex; align-items: center; gap: 8px; background: var(--bg-tertiary); padding: 6px 12px; border-radius: 8px; }
.file-preview-thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }
.file-preview-icon { font-size: 24px; }
.file-preview-name { font-size: 13px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview-size { font-size: 11px; color: var(--text-muted); }
.btn-remove-files { position: absolute; top: 4px; right: 8px; background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; padding: 2px 6px; }
.btn-remove-files:hover { color: var(--danger); }

/* === FILE IN MESSAGE === */
.msg-file { margin-top: 8px; }
.msg-image { max-width: 400px; max-height: 300px; border-radius: 8px; cursor: pointer; transition: opacity 0.2s; }
.msg-image:hover { opacity: 0.9; }
.msg-file-link { display: flex; align-items: center; gap: 12px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; text-decoration: none; color: var(--text-primary); max-width: 350px; transition: background 0.15s; }
.msg-file-link:hover { background: var(--bg-hover); }
.msg-file-icon { font-size: 28px; flex-shrink: 0; }
.msg-file-info { flex: 1; min-width: 0; }
.msg-file-name { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-file-size { font-size: 12px; color: var(--text-muted); }
.msg-file-download { font-size: 18px; color: var(--accent); flex-shrink: 0; }

/* === DRAG & DROP === */
.chat-area.drag-over { outline: 2px dashed var(--accent); outline-offset: -4px; background: rgba(59, 130, 246, 0.05); }
