* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --bg-primary: #0d0d0d;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #242424;
    --bg-glass: rgba(36,36,36,0.7);
    --bg-glass-hover: rgba(36,36,36,0.85);
    --text-primary: #e8e8e8;
    --text-secondary: #999;
    --text-muted: #666;
    --border-color: #333;
    --border-light: #2a2a2a;
    --hover-bg: #2a2a2a;
    --active-bg: #333;
    --accent: #d4d4d4;
    --accent-hover: #fff;
    --danger: #e44;
    --success: #4caf50;
    --warning: #ff9800;
    --online: #4caf50;
    --idle: #ff9800;
    --dnd: #e44;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 50%;
    --font: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,sans-serif;
    --transition: all 0.2s ease;
}
html, body { height: 100%; overflow: hidden; }
body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
}
a { color: var(--text-primary); text-decoration: none; }
a:hover { color: var(--accent-hover); }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* Auth Pages */
.auth-page {
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-primary);
    min-height: 100vh;
}
.auth-container { width: 100%; max-width: 420px; padding: 20px; }
.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    box-shadow: var(--shadow);
}
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-header svg { color: var(--accent); margin-bottom: 12px; }
.auth-header h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
.auth-header p { color: var(--text-secondary); margin-top: 4px; font-size: 15px; }
.auth-form .form-group { margin-bottom: 16px; }
.auth-form label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); margin-bottom: 6px; }
.auth-form input {
    width: 100%; padding: 12px 14px;
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary); font-size: 15px; outline: none; transition: var(--transition);
}
.auth-form input:focus { border-color: var(--accent); }
.upload-group { display: flex; flex-direction: column; align-items: center; }
.reg-upload {
    width: 100%; border: 2px dashed var(--border-color); border-radius: var(--radius-md);
    cursor: pointer; transition: var(--transition); overflow: hidden; position: relative;
    display: flex; align-items: center; justify-content: center;
}
.reg-upload:hover { border-color: var(--accent); background: var(--hover-bg); }
.reg-upload.avatar-upload { width: 100px; height: 100px; border-radius: 50%; }
.reg-upload.banner-upload { width: 100%; height: 100px; border-radius: var(--radius-sm); }
.reg-upload-preview {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; color: var(--text-muted); font-size: 12px; width: 100%; height: 100%;
}
.reg-upload-preview svg { opacity: 0.5; }
.reg-upload-preview span { opacity: 0.7; }
.reg-upload:hover .reg-upload-preview { color: var(--text-primary); }
.reg-upload:hover .reg-upload-preview svg { opacity: 0.8; }
.btn-primary {
    width: 100%; padding: 12px; margin-top: 8px;
    background: var(--text-primary); color: var(--bg-primary);
    border: none; border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 600; cursor: pointer;
    transition: var(--transition);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.auth-footer { text-align: center; margin-top: 16px; color: var(--text-secondary); font-size: 13px; }
.auth-footer a { color: var(--accent); font-weight: 600; }
.auth-footer a:hover { color: var(--accent-hover); text-decoration: underline; }
.error-msg { color: var(--danger); font-size: 13px; text-align: center; margin-top: 10px; }

/* Main Layout - Discord Style */
.app-container {
    display: flex; height: 100vh; width: 100vw;
    background: var(--bg-primary); overflow: hidden;
}

/* Server Sidebar */
.server-sidebar {
    width: 72px; background: var(--bg-primary);
    display: flex; flex-direction: column;
    align-items: center; padding: 12px 0;
    gap: 8px; flex-shrink: 0;
    border-right: 1px solid var(--border-light);
    overflow-y: auto;
}
.server-icon {
    width: 48px; height: 48px; border-radius: var(--radius-full);
    background: var(--bg-tertiary); border: none;
    color: var(--text-primary); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 700; transition: var(--transition);
    position: relative; flex-shrink: 0;
}
.server-icon:hover, .server-icon.active {
    border-radius: var(--radius-lg);
    background: var(--accent); color: var(--bg-primary);
}
.server-icon .dm-icon { font-size: 22px; }
.server-icon .pill { display: none; }
.server-icon.active .pill, .server-icon:hover .pill {
    display: block; position: absolute; left: -12px; top: 50%;
    transform: translateY(-50%);
    width: 4px; height: 20px; background: var(--text-primary);
    border-radius: 0 2px 2px 0;
}
.server-divider {
    width: 32px; height: 2px; background: var(--border-color);
    border-radius: 1px; margin: 4px 0;
}
.server-add {
    width: 48px; height: 48px; border-radius: var(--radius-full);
    background: transparent; border: 2px dashed var(--border-color);
    color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; transition: var(--transition);
}
.server-add:hover {
    border-color: var(--accent); color: var(--accent);
    border-radius: var(--radius-lg);
}

/* Channel Sidebar */
.channel-sidebar {
    width: 240px; background: var(--bg-secondary);
    display: flex; flex-direction: column; flex-shrink: 0;
    border-right: 1px solid var(--border-light);
}
.channel-header {
    padding: 16px 16px 8px; font-weight: 600; font-size: 15px;
    display: flex; align-items: center; justify-content: space-between;
    cursor: pointer; transition: var(--transition);
    border-bottom: 1px solid var(--border-light);
    height: 48px; flex-shrink: 0;
}
.channel-header:hover { background: var(--hover-bg); }
.channel-header-actions {
    display: flex; gap: 4px;
}
.channel-header-actions button {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 4px; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.channel-header-actions button:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.channel-search {
    padding: 8px 12px; flex-shrink: 0;
}
.channel-search input {
    width: 100%; padding: 6px 12px;
    background: var(--bg-primary); border: none; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 13px; outline: none;
}
.channel-search input::placeholder { color: var(--text-muted); }
.channel-category {
    padding: 16px 12px 4px; font-size: 11px;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-muted); font-weight: 600;
    display: flex; align-items: center; justify-content: space-between;
    cursor: pointer; user-select: none;
}
.channel-item {
    display: flex; align-items: center;
    padding: 6px 12px; margin: 1px 8px;
    border-radius: var(--radius-sm); cursor: pointer;
    color: var(--text-secondary); transition: var(--transition);
    gap: 8px; position: relative;
}
.channel-item:hover { background: var(--hover-bg); color: var(--text-primary); }
.channel-item.active { background: var(--active-bg); color: var(--text-primary); }
.channel-item .hash { font-size: 18px; font-weight: 300; opacity: 0.7; }
.channel-item .channel-name { font-size: 14px; font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-item .channel-badge {
    font-size: 10px; padding: 1px 4px;
    background: var(--bg-tertiary); border-radius: 4px;
    color: var(--text-muted); font-weight: 600;
}
.channel-item .channel-dm-status {
    width: 8px; height: 8px; border-radius: var(--radius-full);
    flex-shrink: 0;
}
.channel-dm {
    display: flex; align-items: center;
    padding: 6px 12px; margin: 1px 8px;
    border-radius: var(--radius-sm); cursor: pointer;
    color: var(--text-secondary); transition: var(--transition);
    gap: 10px;
}
.channel-dm:hover { background: var(--hover-bg); color: var(--text-primary); }
.channel-dm.active { background: var(--active-bg); color: var(--text-primary); }
.channel-dm .dm-avatar {
    width: 32px; height: 32px; border-radius: var(--radius-full);
    background: var(--bg-tertiary); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 14px; color: var(--text-primary);
    position: relative;
}
.channel-dm .dm-status {
    width: 12px; height: 12px; border-radius: var(--radius-full);
    position: absolute; bottom: -2px; right: -2px;
    border: 2px solid var(--bg-secondary);
    z-index: 10;
}
.channel-dm .dm-name { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-users {
    flex: 1; overflow-y: auto; padding: 4px 0;
}

/* User info at bottom of channel sidebar */
.user-panel {
    padding: 8px; margin-top: auto;
    background: var(--bg-tertiary); display: flex;
    align-items: center; gap: 8px; flex-shrink: 0;
    border-top: 1px solid var(--border-light);
}
.user-panel-avatar {
    width: 32px; height: 32px; border-radius: var(--radius-full);
    background: var(--accent); color: var(--bg-primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.user-panel-info { flex: 1; min-width: 0; }
.user-panel-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-panel-status { font-size: 11px; color: var(--text-muted); }
.user-panel-actions {
    display: flex; gap: 2px;
}
.user-panel-actions button {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 4px; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.user-panel-actions button:hover { color: var(--text-primary); background: var(--hover-bg); }

/* Main Chat Area */
.main-content {
    flex: 1; display: flex; flex-direction: column;
    background: var(--bg-primary); min-width: 0;
}
.chat-header {
    height: 48px; padding: 0 16px;
    display: flex; align-items: center;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0; gap: 12px;
}
.chat-header .hash-icon { font-size: 20px; color: var(--text-muted); font-weight: 300; }
.chat-header .chat-title { font-size: 16px; font-weight: 600; }
.chat-header .chat-divider { width: 1px; height: 24px; background: var(--border-color); }
.chat-header .chat-topic { font-size: 13px; color: var(--text-muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-header-actions {
    display: flex; gap: 4px; align-items: center; margin-left: auto;
}
.chat-header-actions button {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 6px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.chat-header-actions button:hover { color: var(--text-primary); background: var(--hover-bg); }

/* Messages Area */
.messages-container {
    flex: 1; overflow-y: auto; padding: 16px 16px 0;
    display: flex; flex-direction: column; gap: 2px;
}
.messages-container .empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%; color: var(--text-muted); gap: 12px;
}
.messages-container .empty-state svg { opacity: 0.3; }
.messages-container .empty-state p { font-size: 16px; font-weight: 500; }
.messages-container .empty-state span { font-size: 13px; color: var(--text-muted); }

/* Message */
.message {
    display: flex; gap: 12px; padding: 4px 0;
    transition: var(--transition); position: relative;
    margin-bottom: 2px;
}
.message:hover { background: var(--bg-secondary); border-radius: var(--radius-sm); margin: 0 -8px; padding: 4px 8px; }
.message-avatar {
    width: 36px; height: 36px; border-radius: var(--radius-full);
    background: var(--bg-tertiary); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px; color: var(--text-primary);
    margin-top: 2px;
}
.message-content { flex: 1; min-width: 0; }
.message-header {
    display: flex; align-items: center; gap: 8px; margin-bottom: 2px;
}
.message-author {
    font-size: 15px; font-weight: 600; cursor: pointer;
}
.message-author:hover { text-decoration: underline; }
.message-timestamp { font-size: 11px; color: var(--text-muted); }
.message-text { font-size: 14px; word-break: break-word; line-height: 1.5; }
.message-text.edited::after { content: ' (edited)'; font-size: 11px; color: var(--text-muted); }
.message-actions {
    display: none; gap: 4px; margin-left: auto;
}
.message:hover .message-actions { display: flex; }
.message-actions button {
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
    color: var(--text-secondary); cursor: pointer;
    padding: 3px 6px; border-radius: 4px;
    font-size: 11px; transition: var(--transition);
    display: flex; align-items: center; gap: 4px;
}
.message-actions button:hover { background: var(--active-bg); color: var(--text-primary); }
.message-actions button.danger:hover { color: var(--danger); border-color: var(--danger); }

/* Reply preview */
.reply-preview {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 8px; margin-bottom: 4px;
    background: var(--bg-tertiary); border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent); font-size: 12px;
}
.reply-preview .reply-author { font-weight: 600; color: var(--accent); }
.reply-preview .reply-text { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.reply-preview .reply-cancel {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 2px; display: flex;
    transition: var(--transition);
}
.reply-preview .reply-cancel:hover { color: var(--text-primary); }

/* Message Input - Telegram Style */
.message-input-container {
    padding: 16px 16px 20px;
    position: relative;
}
.message-input-edit-notice {
    display: none; align-items: center; gap: 8px;
    padding: 6px 14px; background: var(--bg-tertiary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    font-size: 12px; color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}
.message-input-edit-notice.show { display: flex; }
.message-input-edit-notice .cancel-edit {
    margin-left: auto; background: none; border: none;
    color: var(--text-muted); cursor: pointer; padding: 2px;
    display: flex; transition: var(--transition);
}
.message-input-edit-notice .cancel-edit:hover { color: var(--text-primary); }

/* Glassmorphism Input - Like Telegram */
.message-input-wrapper {
    display: flex; align-items: center; gap: 8px;
    padding: 0 16px;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    transition: var(--transition);
    position: relative;
}
.message-input-wrapper:focus-within {
    border-color: var(--accent);
    background: var(--bg-glass-hover);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.05);
}
.message-input-wrapper textarea {
    flex: 1; background: none; border: none; outline: none;
    color: var(--text-primary); font-size: 14px;
    font-family: var(--font); resize: none;
    padding: 10px 0; max-height: 150px;
    line-height: 1.5;
}
.message-input-wrapper textarea::placeholder { color: var(--text-muted); }
.message-input-actions {
    display: flex; align-items: center; gap: 4px;
    flex-shrink: 0;
}
.message-input-actions button {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 6px; border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.message-input-actions button:hover { color: var(--text-primary); background: var(--hover-bg); }
/* Send button - round, inside input, like Telegram */
.btn-send {
    width: 36px; height: 36px; border-radius: var(--radius-full);
    background: var(--accent); border: none;
    color: var(--bg-primary); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition); flex-shrink: 0;
}
.btn-send:hover { background: var(--accent-hover); transform: scale(1.05); }
.btn-send:active { transform: scale(0.95); }
.btn-send svg { width: 18px; height: 18px; }

/* Right Panel - User List */
.right-panel {
    width: 240px; background: var(--bg-secondary);
    display: flex; flex-direction: column; flex-shrink: 0;
    border-left: 1px solid var(--border-light);
    padding: 16px; overflow-y: auto;
}
.right-panel h3 {
    font-size: 12px; text-transform: uppercase;
    letter-spacing: 1px; color: var(--text-muted);
    margin-bottom: 12px; font-weight: 600;
}
.right-panel-user {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 8px; border-radius: var(--radius-sm);
    cursor: pointer; transition: var(--transition);
}
.right-panel-user:hover { background: var(--hover-bg); }
.right-panel-user .rp-avatar {
    width: 28px; height: 28px; border-radius: var(--radius-full);
    background: var(--bg-tertiary); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; position: relative;
}
.right-panel-user .rp-status {
    width: 10px; height: 10px; border-radius: var(--radius-full);
    position: absolute; bottom: -1px; right: -1px;
    border: 2px solid var(--bg-secondary);
    z-index: 10;
}
.right-panel-user .rp-status.online { background: var(--online); }
.right-panel-user .rp-status.idle { background: var(--idle); }
.right-panel-user .rp-status.dnd { background: var(--dnd); }
.right-panel-user .rp-name { font-size: 13px; font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right-panel-user .rp-role { font-size: 10px; color: var(--text-muted); padding: 1px 4px; background: var(--bg-tertiary); border-radius: 4px; }

/* Admin Badge */
.role-badge.owner { color: #fff; }
.role-badge.admin { color: #ccc; }
.role-badge.moderator { color: #999; }

/* Inline edit */
.edit-input {
    width: 100%; padding: 6px 10px;
    background: var(--bg-tertiary); border: 1px solid var(--accent);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-size: 14px; font-family: var(--font); outline: none;
}

/* Modal */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    align-items: center; justify-content: center;
    z-index: 1000;
}
.modal-overlay.show { display: flex; }
.modal {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 24px;
    width: 90%; max-width: 440px; box-shadow: var(--shadow);
}
.modal h2 { font-size: 20px; margin-bottom: 16px; }
.modal p { color: var(--text-secondary); font-size: 14px; margin-bottom: 16px; }
.modal input, .modal select {
    width: 100%; padding: 10px 12px; margin-bottom: 12px;
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-size: 14px; outline: none;
}
.modal input:focus { border-color: var(--accent); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.modal-actions button {
    padding: 8px 20px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; cursor: pointer;
    border: none; transition: var(--transition);
}
.modal-actions .btn-cancel { background: var(--bg-tertiary); color: var(--text-secondary); }
.modal-actions .btn-cancel:hover { background: var(--active-bg); }
.modal-actions .btn-confirm { background: var(--text-primary); color: var(--bg-primary); }
.modal-actions .btn-confirm:hover { background: var(--accent-hover); }
.modal-actions .btn-danger { background: var(--danger); color: #fff; }
.modal-actions .btn-danger:hover { opacity: 0.9; }

/* Call UI */
.call-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.9);
    align-items: center; justify-content: center;
    z-index: 1000; flex-direction: column; gap: 24px;
}
.call-overlay.show { display: flex; }
.call-avatar {
    width: 120px; height: 120px; border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    display: flex; align-items: center; justify-content: center;
    font-size: 48px; font-weight: 700;
}
.call-name { font-size: 24px; font-weight: 600; }
.call-status { font-size: 14px; color: var(--text-muted); }
.call-controls {
    display: flex; gap: 16px; margin-top: 24px;
}
.call-controls button {
    width: 52px; height: 52px; border-radius: var(--radius-full);
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition); font-size: 22px;
}
.call-controls .call-mic, .call-controls .call-video {
    background: var(--bg-tertiary); color: var(--text-primary);
}
.call-controls .call-mic:hover, .call-controls .call-video:hover { background: var(--active-bg); }
.call-controls .call-end {
    background: var(--danger); color: #fff;
}
.call-controls .call-end:hover { opacity: 0.9; }

/* Admin Panel */
.admin-page {
    display: flex; min-height: 100vh; background: var(--bg-primary);
}
.admin-sidebar {
    width: 240px; background: var(--bg-secondary);
    border-right: 1px solid var(--border-light);
    padding: 20px 0; flex-shrink: 0; display: flex;
    flex-direction: column;
}
.admin-sidebar h2 {
    padding: 0 20px 20px; font-size: 18px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 12px; display: flex; align-items: center; gap: 10px;
}
.admin-sidebar h2 a { font-size: 14px; color: var(--text-muted); }
.admin-sidebar h2 a:hover { color: var(--text-primary); }
.admin-nav-item {
    padding: 10px 20px; display: flex; align-items: center;
    gap: 10px; color: var(--text-secondary); cursor: pointer;
    transition: var(--transition); border: none; background: none;
    width: 100%; text-align: left; font-size: 14px; font-family: var(--font);
}
.admin-nav-item:hover { background: var(--hover-bg); color: var(--text-primary); }
.admin-nav-item.active { background: var(--active-bg); color: var(--text-primary); border-right: 3px solid var(--accent); }
.admin-content {
    flex: 1; padding: 24px 32px; overflow-y: auto;
}
.admin-content h1 { font-size: 24px; margin-bottom: 24px; }
.admin-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px; margin-bottom: 32px;
}
.admin-stat-card {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); padding: 20px;
}
.admin-stat-card h3 { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.admin-stat-card .stat-value { font-size: 28px; font-weight: 700; }
.admin-table {
    width: 100%; border-collapse: collapse;
    background: var(--bg-secondary); border-radius: var(--radius-md);
    overflow: hidden;
}
.admin-table th {
    text-align: left; padding: 12px 16px;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-muted); border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}
.admin-table td {
    padding: 12px 16px; border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}
.admin-table tr:hover td { background: var(--hover-bg); }
.admin-table .user-status { display: flex; align-items: center; gap: 6px; }
.admin-table .user-status-dot {
    width: 8px; height: 8px; border-radius: var(--radius-full);
}
.admin-table .user-status-dot.online { background: #4caf50; }
.admin-table .user-status-dot.offline { background: #666; }
.admin-table .user-status-dot.idle { background: #ff9800; }
.admin-table .user-status-dot.dnd { background: #e44; }
.admin-actions { display: flex; gap: 4px; }
.admin-actions button {
    background: none; border: 1px solid var(--border-color);
    color: var(--text-secondary); cursor: pointer;
    padding: 4px 8px; border-radius: 4px; font-size: 12px;
    transition: var(--transition);
}
.admin-actions button:hover { background: var(--active-bg); color: var(--text-primary); }
.admin-actions button.danger:hover { color: var(--danger); border-color: var(--danger); }
.admin-logs { max-height: 400px; overflow-y: auto; }
.admin-log-item {
    padding: 10px 0; border-bottom: 1px solid var(--border-light);
    font-size: 13px; display: flex; gap: 8px;
}
.admin-log-item .log-time { color: var(--text-muted); white-space: nowrap; }
.admin-log-item .log-action { color: var(--text-secondary); flex: 1; }

/* Notification toast */
.toast {
    position: fixed; bottom: 24px; right: 24px;
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); padding: 12px 20px;
    color: var(--text-primary); font-size: 14px;
    box-shadow: var(--shadow); z-index: 2000;
    display: none; align-items: center; gap: 10px;
    animation: slideUp 0.3s ease;
}
.toast.show { display: flex; }
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== Responsive / Hamburger ========== */
.hamburger-btn {
    display: none; background: none; border: none;
    color: var(--text-secondary); cursor: pointer;
    padding: 4px; border-radius: 4px;
    align-items: center; justify-content: center;
    transition: var(--transition);
}
.hamburger-btn:hover { color: var(--text-primary); background: var(--hover-bg); }

.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.6); z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* Status dot z-index everywhere */
.dm-status, .rp-status, .user-panel-avatar .dm-status {
    z-index: 10 !important;
}
.dm-status.online { background: var(--online); }
.dm-status.idle { background: var(--idle); }
.dm-status.dnd { background: var(--dnd); }
.dm-status.offline { background: #666; }
.user-panel-avatar {
    z-index: 1;
}

@media (max-width: 1100px) {
    .right-panel { display: none; }
}
@media (max-width: 820px) {
    .hamburger-btn { display: flex; }
    .server-sidebar {
        position: fixed; left: -72px; top: 0; bottom: 0;
        z-index: 100; transition: left 0.25s ease;
        border-right: 1px solid var(--border-color);
        box-shadow: 2px 0 20px rgba(0,0,0,0.5);
    }
    .server-sidebar.open { left: 0; }
    .channel-sidebar {
        position: fixed; left: -240px; top: 0; bottom: 0;
        z-index: 100; transition: left 0.25s ease;
        border-right: 1px solid var(--border-color);
        box-shadow: 2px 0 20px rgba(0,0,0,0.5);
    }
    .channel-sidebar.open { left: 0; }
    .channel-sidebar.open + .server-sidebar { left: 0; }
    .server-sidebar.open ~ .sidebar-overlay,
    .channel-sidebar.open ~ .sidebar-overlay { display: block; }
    .chat-header .chat-topic { display: none; }
    .chat-header .hash-icon { display: none; }
}
@media (max-width: 480px) {
    .server-sidebar { width: 60px; left: -60px; }
    .server-sidebar.open { left: 0; }
    .channel-sidebar { width: 220px; left: -220px; }
    .channel-sidebar.open { left: 0; }
}
/* Auth pages responsive */
@media (max-width: 480px) {
    .auth-container { padding: 12px; }
    .auth-card { padding: 24px 16px; border-radius: var(--radius-md); }
    .auth-header { margin-bottom: 24px; }
    .auth-header h1 { font-size: 22px; }
    .auth-header p { font-size: 13px; }
    .auth-form input { padding: 10px 12px; font-size: 14px; }
    .auth-form .form-group { margin-bottom: 12px; }
    .auth-form label { font-size: 11px; }
    .reg-upload.avatar-upload { width: 80px; height: 80px; }
    .reg-upload.banner-upload { height: 80px; }
    .reg-upload-preview svg { width: 24px; height: 24px; }
    .reg-upload-preview span { font-size: 11px; }
}

/* Status selector */
.status-selector {
    position: absolute; bottom: 100%; left: 8px;
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); box-shadow: var(--shadow);
    display: none; flex-direction: column; padding: 4px;
    z-index: 100;
}
.status-selector.show { display: flex; }
.status-option {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; cursor: pointer; border-radius: var(--radius-sm);
    transition: var(--transition); border: none; background: none;
    color: var(--text-primary); font-size: 13px; font-family: var(--font);
    white-space: nowrap;
}
.status-option:hover { background: var(--hover-bg); }
.status-dot { width: 10px; height: 10px; border-radius: var(--radius-full); }
.status-dot.online { background: var(--online); }
.status-dot.idle { background: var(--idle); }
.status-dot.dnd { background: var(--dnd); }
.status-dot.offline { background: #666; }

/* Server / Channel Settings */
.settings-panel {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 0;
    width: 90%; max-width: 520px; max-height: 80vh;
    display: flex; flex-direction: column;
}
.settings-panel.settings-server { max-width: 560px; }
.settings-panel .settings-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid var(--border-light);
}
.settings-panel .settings-header h2 { margin: 0; font-size: 18px; }
.settings-panel .settings-body {
    padding: 20px 24px; overflow-y: auto; flex: 1;
}
.settings-panel .settings-section {
    margin-bottom: 24px;
}
.settings-panel .settings-section h3 {
    font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-muted); margin-bottom: 12px; font-weight: 600;
}
.settings-panel .settings-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0; border-bottom: 1px solid var(--border-light);
}
.settings-panel .settings-row:last-child { border-bottom: none; }
.settings-panel .settings-row label { font-size: 14px; color: var(--text-primary); }
.settings-panel .settings-row select, 
.settings-panel .settings-row input {
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
    color: var(--text-primary); padding: 6px 10px;
    border-radius: var(--radius-sm); font-size: 13px; outline: none;
}
.settings-panel .settings-row select:focus,
.settings-panel .settings-row input:focus { border-color: var(--accent); }
.settings-panel .settings-row .btn-small {
    padding: 6px 14px; border-radius: var(--radius-sm); font-size: 12px;
    font-weight: 500; cursor: pointer; border: none; transition: var(--transition);
}
.settings-panel .settings-row .btn-small.danger {
    background: var(--danger); color: #fff;
}
.settings-panel .settings-row .btn-small.danger:hover { opacity: 0.85; }
.settings-panel .settings-row .btn-small.primary {
    background: var(--accent); color: var(--bg-primary);
}
.settings-panel .settings-row .btn-small.primary:hover { background: var(--accent-hover); }

/* Invite link display */
.invite-box {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); padding: 8px 12px;
    margin-top: 8px;
}
.invite-box input {
    flex: 1; background: none; border: none; outline: none;
    color: var(--text-primary); font-size: 13px;
}
.invite-box button {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 4px; display: flex;
    transition: var(--transition);
}
.invite-box button:hover { color: var(--text-primary); }

/* Member list in settings */
.member-list-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0; border-bottom: 1px solid var(--border-light);
}
.member-list-item:last-child { border-bottom: none; }
.member-list-item .ml-avatar {
    width: 28px; height: 28px; border-radius: var(--radius-full);
    background: var(--bg-tertiary); display: flex;
    align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.member-list-item .ml-name { flex: 1; font-size: 14px; }
.member-list-item .ml-role { font-size: 11px; color: var(--text-muted); }

/* Channel item settings gear */
.channel-item .channel-settings-btn {
    display: none; background: none; border: none;
    color: var(--text-muted); cursor: pointer; padding: 2px;
    border-radius: 3px; transition: var(--transition);
}
.channel-item:hover .channel-settings-btn { display: flex; }
.channel-item .channel-settings-btn:hover { color: var(--text-primary); background: var(--hover-bg); }

/* ========== Context Menu (Right Click) ========== */
.context-menu {
    position: fixed; z-index: 5000;
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); box-shadow: 0 4px 24px rgba(0,0,0,0.5);
    padding: 4px; min-width: 160px;
    display: none;
}
.context-menu.show { display: block; }
.context-menu-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; cursor: pointer; border-radius: var(--radius-sm);
    color: var(--text-primary); font-size: 13px;
    border: none; background: none; width: 100%; text-align: left;
    font-family: var(--font); transition: var(--transition);
}
.context-menu-item:hover { background: var(--hover-bg); }
.context-menu-item.danger { color: var(--danger); }
.context-menu-item.danger:hover { background: rgba(238,68,68,0.15); }
.context-menu-divider { height: 1px; background: var(--border-color); margin: 4px 0; }

/* ========== RTL / LTR Messages ========== */
.message.mine { flex-direction: row-reverse; }
.message.mine .message-content { text-align: right; }
.message.mine .message-header { flex-direction: row-reverse; }
.message.mine .message-text { text-align: right; }
.message.other .message-content { text-align: left; }
.message.other .message-text { text-align: left; }

/* ========== User Profile Popup ========== */
.profile-popup {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); overflow: hidden;
    width: 90%; max-width: 360px; box-shadow: var(--shadow);
}
.profile-banner {
    width: 100%; height: 120px; background: var(--bg-tertiary);
    object-fit: cover; display: block;
}
.profile-banner-placeholder {
    width: 100%; height: 120px; background: linear-gradient(135deg, #333, #555);
}
.profile-info {
    padding: 0 20px 20px; margin-top: -40px; position: relative;
}
.profile-avatar-wrapper {
    width: 80px; height: 80px; border-radius: var(--radius-full);
    border: 4px solid var(--bg-secondary); overflow: hidden;
    background: var(--bg-tertiary); display: flex;
    align-items: center; justify-content: center;
    font-size: 32px; font-weight: 700;
}
.profile-avatar-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-size: 20px; font-weight: 700; margin-top: 8px; }
.profile-status { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.profile-description { font-size: 13px; color: var(--text-secondary); margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-light); }
.profile-meta { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.profile-actions { display: flex; gap: 8px; margin-top: 16px; }
.profile-actions button {
    flex: 1; padding: 8px; border-radius: var(--radius-sm);
    border: none; font-size: 13px; font-weight: 500; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: var(--transition);
}
.profile-actions .btn-dm { background: var(--accent); color: var(--bg-primary); }
.profile-actions .btn-dm:hover { background: var(--accent-hover); }
.profile-actions .btn-add { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border-color); }
.profile-actions .btn-add:hover { background: var(--active-bg); }
.profile-actions .btn-pending { background: var(--bg-tertiary); color: var(--text-muted); cursor: default; }
.profile-actions .btn-friends { background: var(--bg-tertiary); color: var(--success); border: 1px solid var(--border-color); }

/* ========== Server Profile ========== */
.server-profile .server-profile-banner {
    width: 100%; height: 140px; position: relative;
    display: flex; align-items: center; justify-content: center;
}
.server-profile .server-profile-icon-wrap {
    display: flex; align-items: center; justify-content: center;
}
.server-profile .server-profile-icon {
    width: 80px; height: 80px; border-radius: var(--radius-lg);
    object-fit: cover; border: 4px solid var(--bg-secondary);
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.server-profile .server-profile-icon.initial {
    background: var(--bg-tertiary); display: flex;
    align-items: center; justify-content: center;
    font-size: 36px; font-weight: 700; color: var(--text-primary);
    width: 80px; height: 80px; border-radius: var(--radius-lg);
}

/* ========== Upload Area ========== */
.upload-area {
    position: relative; cursor: pointer; overflow: hidden;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md); transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
    min-height: 80px; background: var(--bg-tertiary);
}
.upload-area:hover { border-color: var(--text-muted); background: var(--hover-bg); }
.upload-area.banner { min-height: 100px; }
.upload-preview {
    width: 100%; height: 100%; display: flex;
    align-items: center; justify-content: center;
    font-size: 13px; color: var(--text-muted); padding: 8px;
}
.upload-preview-img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }
.upload-area .upload-placeholder {
    width: 60px; height: 60px; border-radius: var(--radius-md);
    background: var(--bg-primary); display: flex;
    align-items: center; justify-content: center;
    font-size: 28px; font-weight: 700; color: var(--text-primary);
}
.upload-area .upload-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    gap: 6px; color: var(--text-primary); font-size: 13px;
    opacity: 0; transition: var(--transition);
}
.upload-area:hover .upload-overlay { opacity: 1; }
.upload-area .upload-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }

/* ========== Friends Tab ========== */
.friends-tab {
    display: flex; align-items: center; gap: 4px;
    padding: 6px 12px; margin: 4px 8px;
    border-radius: var(--radius-sm); cursor: pointer;
    color: var(--text-secondary); transition: var(--transition);
    background: none; border: none; width: calc(100% - 16px);
    font-family: var(--font); font-size: 14px; text-align: left;
}
.friends-tab:hover { background: var(--hover-bg); color: var(--text-primary); }
.friends-tab.active { background: var(--active-bg); color: var(--text-primary); }

.friend-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; margin: 1px 8px;
    border-radius: var(--radius-sm); cursor: pointer;
    color: var(--text-secondary); transition: var(--transition);
}
.friend-item:hover { background: var(--hover-bg); color: var(--text-primary); }
.friend-item .fi-avatar {
    width: 32px; height: 32px; border-radius: var(--radius-full);
    background: var(--bg-tertiary); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 14px; position: relative;
}
.friend-item .fi-status {
    width: 10px; height: 10px; border-radius: var(--radius-full);
    position: absolute; bottom: -1px; right: -1px;
    border: 2px solid var(--bg-secondary);
}
.friend-item .fi-name { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-item .fi-actions { display: flex; gap: 2px; }
.friend-item .fi-actions button {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 4px; border-radius: 4px;
    display: flex; transition: var(--transition);
}
.friend-item .fi-actions button:hover { color: var(--text-primary); background: var(--hover-bg); }

/* Friend request badges */
.friend-request-badge {
    background: var(--danger); color: #fff; font-size: 10px;
    padding: 1px 5px; border-radius: 10px; margin-left: auto;
}

/* ========== Emoji Picker ========== */
.emoji-picker {
    position: absolute; bottom: 100%; left: 0; margin-bottom: 8px;
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); box-shadow: var(--shadow);
    padding: 8px; display: none; z-index: 100;
    width: 280px; max-height: 200px; overflow-y: auto;
}
.emoji-picker.show { display: flex; flex-wrap: wrap; gap: 4px; }
.emoji-picker .emoji-btn {
    background: none; border: none; cursor: pointer;
    font-size: 22px; padding: 4px; border-radius: 4px;
    transition: var(--transition); width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
}
.emoji-picker .emoji-btn:hover { background: var(--hover-bg); }
.emoji-picker .emoji-cat {
    width: 100%; font-size: 11px; text-transform: uppercase;
    color: var(--text-muted); padding: 4px 0; letter-spacing: 0.5px;
}

/* ========== GIF picker ========== */
.gif-picker {
    position: absolute; bottom: 100%; left: 0; margin-bottom: 8px;
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); box-shadow: var(--shadow);
    padding: 8px; display: none; z-index: 100;
    width: 280px; max-height: 240px; overflow-y: auto;
}
.gif-picker.show { display: block; }
.gif-picker input {
    width: 100%; padding: 6px 10px; margin-bottom: 8px;
    background: var(--bg-primary); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-size: 13px; outline: none;
}
.gif-picker .gif-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.gif-picker .gif-grid img {
    width: 100%; aspect-ratio: 1; object-fit: cover;
    border-radius: 4px; cursor: pointer;
}
.gif-picker .gif-grid img:hover { opacity: 0.85; }

/* ========== Members Panel Overlay (Server) ========== */
.members-overlay {
    display: none; position: absolute; top: 48px; right: 0; bottom: 0;
    width: 240px; background: var(--bg-secondary);
    border-left: 1px solid var(--border-light);
    flex-direction: column; z-index: 50;
}
.members-overlay.show { display: flex; }
.members-overlay .mo-header {
    padding: 12px 16px; font-size: 11px; text-transform: uppercase;
    letter-spacing: 1px; color: var(--text-muted); font-weight: 600;
    border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; justify-content: space-between;
}
.members-overlay .mo-header button {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 2px; display: flex;
}
.members-overlay .mo-list { flex: 1; overflow-y: auto; padding: 8px; }
.mo-category { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; padding: 8px 4px 4px; }
.mo-user {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px; border-radius: var(--radius-sm);
    cursor: pointer; transition: var(--transition);
}
.mo-user:hover { background: var(--hover-bg); }
.mo-user .mo-avatar {
    width: 28px; height: 28px; border-radius: var(--radius-full);
    background: var(--bg-tertiary); display: flex;
    align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; flex-shrink: 0; position: relative;
}
.mo-user .mo-status {
    width: 8px; height: 8px; border-radius: var(--radius-full);
    position: absolute; bottom: -1px; right: -1px;
    border: 2px solid var(--bg-secondary);
}
.mo-user .mo-status.online { background: var(--online); }
.mo-user .mo-status.offline { background: #666; }
.mo-user .mo-status.idle { background: var(--idle); }
.mo-user .mo-status.dnd { background: var(--dnd); }
.mo-user .mo-name { font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mo-user .mo-role { font-size: 10px; color: var(--text-muted); }

/* ========== Invite Preview Page ========== */
.invite-preview-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,0,0,0.85);
    display: flex; align-items: center; justify-content: center;
}
.invite-preview {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); overflow: hidden;
    text-align: center; max-width: 360px; width: 90%;
    box-shadow: 0 0 60px rgba(0,0,0,0.5);
}
.invite-preview .ip-banner {
    width: 100%; height: 120px;
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
.invite-preview .ip-icon {
    width: 80px; height: 80px; border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; font-weight: 700;
    border: 4px solid var(--bg-secondary);
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.invite-preview .ip-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-lg); }
.invite-preview .ip-body { padding: 0 32px 32px; margin-top: -40px; }
.invite-preview .ip-name { font-size: 24px; font-weight: 700; margin-bottom: 4px; padding: 0 32px; margin-top: 16px; }
.invite-preview .ip-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; padding: 0 32px; }
.invite-preview .ip-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; padding: 0 32px; }
.invite-preview .ip-btn {
    width: calc(100% - 64px); margin: 0 32px 32px; padding: 12px; border-radius: var(--radius-sm);
    background: var(--accent); color: var(--bg-primary);
    border: none; font-size: 15px; font-weight: 600; cursor: pointer;
    transition: var(--transition);
}
.invite-preview .ip-btn:hover { background: var(--accent-hover); }
.invite-preview .ip-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ========== Create Server Modal ========== */
.create-server-modal { max-width: 480px; }
.create-server-modal .settings-section { margin-bottom: 16px; }
.create-server-modal .settings-section h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 8px; font-weight: 600; }
.banner-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.banner-tabs .bt-tab {
    padding: 4px 14px; border-radius: var(--radius-sm); cursor: pointer;
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
    color: var(--text-secondary); font-size: 12px; transition: var(--transition);
    font-family: var(--font);
}
.banner-tabs .bt-tab.active { background: var(--accent); color: var(--bg-primary); border-color: var(--accent); }
.banner-tabs .bt-tab:hover:not(.active) { background: var(--hover-bg); }
.banner-tab-content { min-height: 80px; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.preset-item {
    height: 60px; border-radius: var(--radius-sm); cursor: pointer;
    border: 2px solid transparent; transition: var(--transition);
}
.preset-item:hover { border-color: var(--text-muted); }
.preset-item.selected { border-color: var(--accent); }

/* ========== Invite Embed in Chat ========== */
.invite-embed {
    display: flex; margin-top: 8px; border: 1px solid var(--border-color);
    border-radius: var(--radius-md); overflow: hidden;
    background: var(--bg-tertiary); max-width: 360px;
}
.invite-embed .ie-banner {
    width: 100px; min-height: 100px; flex-shrink: 0;
    background: linear-gradient(135deg, #333, #555);
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
.invite-embed .ie-icon {
    width: 48px; height: 48px; border-radius: var(--radius-md);
    background: var(--bg-secondary); overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 700; flex-shrink: 0;
    border: 2px solid var(--bg-secondary);
}
.invite-embed .ie-icon img { width: 100%; height: 100%; object-fit: cover; }
.invite-embed .ie-body {
    padding: 10px 12px; flex: 1; display: flex;
    flex-direction: column; justify-content: center;
}
.invite-embed .ie-name { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.invite-embed .ie-desc { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.invite-embed .ie-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.invite-embed .ie-btn {
    padding: 4px 12px; border-radius: var(--radius-sm);
    background: var(--accent); color: var(--bg-primary);
    border: none; font-size: 12px; font-weight: 600; cursor: pointer;
    transition: var(--transition); align-self: flex-start;
}
.invite-embed .ie-btn:hover { background: var(--accent-hover); }

/* Video call */
.video-container {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 16px; width: 90%; max-width: 900px;
}
.video-container video {
    width: 100%; border-radius: var(--radius-lg);
    background: #000; aspect-ratio: 16/9;
    object-fit: cover;
}
.local-video { position: relative; }
.local-video .mini-label {
    position: absolute; bottom: 8px; left: 8px;
    background: rgba(0,0,0,0.6); padding: 4px 8px;
    border-radius: 4px; font-size: 11px;
}
