/* styles.css — Nexus Platform */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:        #0d0e14;
  --bg2:       #12141c;
  --bg3:       #181a25;
  --bg4:       #1f2130;
  --border:    #2a2d3e;
  --border2:   #353849;
  --text:      #e4e6f0;
  --text2:     #9599b3;
  --text3:     #5a5e78;
  --accent:    #6366f1;
  --accent2:   #818cf8;
  --purple:    #a855f7;
  --green:     #22c55e;
  --red:       #ef4444;
  --yellow:    #f59e0b;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
  --font:      'Space Grotesk', system-ui, sans-serif;
  --mono:      'DM Mono', monospace;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }
a { color: var(--accent2); text-decoration: none; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); }

/* ── Auth ───────────────────────────────────────────────────── */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }

.auth-bg { position: fixed; inset: 0; pointer-events: none; }
.auth-orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.15; animation: orb-drift 8s ease-in-out infinite; }
.auth-orb-1 { width: 500px; height: 500px; background: var(--accent); top: -200px; left: -200px; animation-delay: 0s; }
.auth-orb-2 { width: 400px; height: 400px; background: var(--purple); bottom: -150px; right: -150px; animation-delay: -3s; }
.auth-orb-3 { width: 300px; height: 300px; background: #06b6d4; top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: -6s; }
.auth-grid { position: absolute; inset: 0; background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: 40px 40px; opacity: 0.3; }

@keyframes orb-drift { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(30px, -20px) scale(1.05); } }

.auth-container { position: relative; z-index: 1; width: 100%; max-width: 420px; padding: 20px; }

.auth-logo { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 28px; }
.auth-logo-text { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.5px; }

.auth-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow), 0 0 0 1px rgba(99,102,241,0.1); }

.auth-tabs { display: flex; background: var(--bg3); border-radius: 8px; padding: 4px; margin-bottom: 24px; }
.auth-tab { flex: 1; padding: 8px; border-radius: 6px; font-size: 0.9rem; font-weight: 500; color: var(--text2); transition: all 0.2s; }
.auth-tab.active { background: var(--bg4); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.3); }

.auth-panel { }
.auth-form-header { margin-bottom: 20px; }
.auth-form-header h2 { font-size: 1.3rem; font-weight: 600; margin-bottom: 4px; }
.auth-form-header p { color: var(--text2); font-size: 0.875rem; }

.auth-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); border-radius: 8px; padding: 10px 14px; color: #fca5a5; font-size: 0.875rem; margin-bottom: 16px; }

.auth-footer { margin-top: 16px; text-align: center; }
.badge-premium { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(168,85,247,0.2)); border: 1px solid rgba(168,85,247,0.3); border-radius: 20px; padding: 6px 14px; font-size: 0.8rem; font-weight: 600; color: #c4b5fd; cursor: pointer; transition: all 0.2s; }
.badge-premium:hover { background: linear-gradient(135deg, rgba(99,102,241,0.3), rgba(168,85,247,0.3)); }
.premium-info { margin-top: 10px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; text-align: left; }
.premium-feature { padding: 4px 0; font-size: 0.875rem; color: var(--text2); }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--text2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-input { width: 100%; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; color: var(--text); font-size: 0.9rem; transition: border-color 0.2s, box-shadow 0.2s; outline: none; resize: vertical; }
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.form-hint { font-size: 0.75rem; color: var(--text3); margin-top: 4px; }
.password-strength { margin-top: 4px; font-size: 0.75rem; font-weight: 500; }

.input-with-eye { position: relative; }
.input-with-eye .form-input { padding-right: 44px; }
.eye-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text3); font-size: 1rem; padding: 4px; }

.toggle-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.9rem; color: var(--text); font-weight: normal; text-transform: none; letter-spacing: 0; }
.toggle-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary { background: var(--accent); color: white; padding: 10px 20px; border-radius: 8px; font-weight: 600; font-size: 0.9rem; transition: background 0.2s, transform 0.1s, opacity 0.2s; }
.btn-primary:hover { background: var(--accent2); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary.full { width: 100%; display: block; text-align: center; }
.btn-ghost { background: var(--bg4); color: var(--text); padding: 8px 16px; border-radius: 8px; font-weight: 500; font-size: 0.875rem; border: 1px solid var(--border); transition: all 0.2s; }
.btn-ghost:hover { border-color: var(--border2); background: var(--bg3); }
.btn-ghost.full { width: 100%; display: block; text-align: center; }
.btn-ghost.small { padding: 6px 12px; font-size: 0.8rem; }
.btn-ghost.tiny { padding: 4px 10px; font-size: 0.75rem; }
.btn-danger { background: rgba(239,68,68,0.15); color: #fca5a5; padding: 8px 16px; border-radius: 8px; font-weight: 500; font-size: 0.875rem; border: 1px solid rgba(239,68,68,0.2); transition: all 0.2s; }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-danger.tiny { padding: 4px 10px; font-size: 0.75rem; }
.btn-premium { background: linear-gradient(135deg, var(--accent), var(--purple)); color: white; padding: 12px 28px; border-radius: 8px; font-weight: 700; font-size: 1rem; width: 100%; transition: opacity 0.2s, transform 0.1s; }
.btn-premium:hover { opacity: 0.9; }
.icon-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--text2); font-size: 1rem; transition: background 0.2s, color 0.2s; }
.icon-btn:hover { background: var(--bg4); color: var(--text); }

/* ── App Layout ─────────────────────────────────────────────── */
.app-body { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar { width: 240px; min-width: 240px; background: var(--bg2); border-right: 1px solid var(--border); display: flex; flex-direction: column; height: 100vh; overflow: hidden; transition: transform 0.3s; }

.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 12px; border-bottom: 1px solid var(--border); }
.sidebar-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1rem; }

.sidebar-section { flex: 1; overflow-y: auto; padding: 8px 0; }
.sidebar-section::-webkit-scrollbar { width: 4px; }
.sidebar-section::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
.sidebar-section-label { padding: 8px 16px 4px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text3); }

.group-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; margin: 1px 8px; cursor: pointer; transition: background 0.15s; }
.group-item:hover { background: var(--bg3); }
.group-item.active { background: rgba(99,102,241,0.15); }
.group-avatar { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--purple)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.875rem; flex-shrink: 0; }
.group-name { font-size: 0.875rem; font-weight: 500; truncate: ellipsis; overflow: hidden; white-space: nowrap; }

.dm-item { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 8px; margin: 1px 8px; cursor: pointer; transition: background 0.15s; position: relative; font-size: 0.875rem; font-weight: 500; }
.dm-item:hover { background: var(--bg3); }
.dm-item.active { background: rgba(99,102,241,0.15); }

.sidebar-ai-dm { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 8px; margin: 1px 8px; cursor: pointer; transition: background 0.15s; font-size: 0.875rem; font-weight: 500; }
.sidebar-ai-dm:hover { background: var(--bg3); }
.ai-avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--purple)); display: flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 700; }
.ai-badge { margin-left: auto; font-size: 0.65rem; background: rgba(99,102,241,0.2); color: var(--accent2); border-radius: 4px; padding: 1px 5px; font-weight: 600; }

.sidebar-user { display: flex; align-items: center; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.user-info { flex: 1; min-width: 0; }
.user-display { display: block; font-size: 0.875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-tag { display: block; font-size: 0.75rem; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.user-avatar-wrap { position: relative; cursor: pointer; }
.user-avatar-sm { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.user-status-dot { position: absolute; bottom: 0; right: 0; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--bg2); }
.user-status-dot.online { background: var(--green); }
.user-status-dot.offline { background: var(--text3); }

.dm-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dm-status.online { background: var(--green); }
.dm-status.offline { background: var(--text3); }

/* ── Channel Sidebar ────────────────────────────────────────── */
.channel-sidebar { width: 200px; min-width: 200px; background: var(--bg3); border-right: 1px solid var(--border); display: flex; flex-direction: column; height: 100vh; }
.channel-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 0.9rem; }
.channel-list { flex: 1; overflow-y: auto; padding: 8px; }
.channel-item { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 6px; cursor: pointer; transition: background 0.15s; font-size: 0.875rem; color: var(--text2); }
.channel-item:hover { background: var(--bg4); color: var(--text); }
.channel-item.active { background: rgba(99,102,241,0.15); color: var(--text); }
.ch-hash { font-weight: 700; font-size: 0.9rem; }
.channel-members-btn { padding: 10px 12px; font-size: 0.8rem; color: var(--text2); cursor: pointer; border-top: 1px solid var(--border); transition: color 0.2s; }
.channel-members-btn:hover { color: var(--text); }

/* ── Main Content ────────────────────────────────────────────── */
.main-content { flex: 1; display: flex; flex-direction: column; height: 100vh; overflow: hidden; min-width: 0; }

.chat-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg2); }
.chat-header-info { flex: 1; min-width: 0; }
.chat-title { display: block; font-weight: 600; font-size: 0.95rem; }
.chat-subtitle { display: block; font-size: 0.75rem; color: var(--text2); }
.chat-header-actions { display: flex; gap: 6px; }

.messages-container { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 2px; scroll-behavior: smooth; }
.messages-container::-webkit-scrollbar { width: 4px; }
.messages-container::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.messages-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; color: var(--text3); gap: 8px; text-align: center; }
.welcome-icon { font-size: 3rem; }
.messages-empty h3 { font-size: 1rem; color: var(--text2); }
.messages-empty p { font-size: 0.875rem; }

/* ── Messages ────────────────────────────────────────────────── */
.message { display: flex; gap: 10px; padding: 4px 8px; border-radius: 8px; transition: background 0.15s; position: relative; }
.message:hover { background: var(--bg3); }
.message:hover .msg-actions { opacity: 1; }
.message.mine .msg-body { }
.message.ai-msg { }

.msg-avatar-wrap { flex-shrink: 0; cursor: pointer; }
.msg-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.msg-ai-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--purple)); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; }

.msg-body { flex: 1; min-width: 0; }
.msg-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.msg-name { font-weight: 600; font-size: 0.9rem; cursor: pointer; }
.msg-name:hover { text-decoration: underline; }
.ai-name { color: var(--accent2); }
.msg-time { font-size: 0.7rem; color: var(--text3); }
.msg-content { font-size: 0.9rem; line-height: 1.55; word-break: break-word; white-space: pre-wrap; }
.msg-content code { font-family: var(--mono); background: var(--bg4); padding: 1px 5px; border-radius: 4px; font-size: 0.85em; }
.msg-reply-ref { font-size: 0.75rem; color: var(--text3); margin-bottom: 3px; padding-left: 8px; border-left: 2px solid var(--border2); }

.msg-image { max-width: 320px; max-height: 240px; border-radius: 8px; margin-top: 6px; object-fit: cover; cursor: pointer; }
.msg-file { display: inline-flex; align-items: center; gap: 6px; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; margin-top: 6px; font-size: 0.85rem; color: var(--text2); transition: border-color 0.2s; }
.msg-file:hover { border-color: var(--accent); }

.msg-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.reaction { background: var(--bg4); border: 1px solid var(--border); border-radius: 12px; padding: 2px 8px; font-size: 0.8rem; transition: all 0.15s; }
.reaction:hover { border-color: var(--accent); }
.reaction.reacted { background: rgba(99,102,241,0.15); border-color: var(--accent); }

.msg-actions { position: absolute; right: 8px; top: 4px; display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.msg-action { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 5px; font-size: 0.85rem; color: var(--text2); transition: all 0.15s; }
.msg-action:hover { background: var(--bg4); color: var(--text); }
.msg-action.danger:hover { color: var(--red); }

.mention { color: var(--accent2); cursor: pointer; font-weight: 500; }
.mention:hover { text-decoration: underline; }

/* ── Typing Area ─────────────────────────────────────────────── */
.typing-area { display: flex; flex-direction: column; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--bg2); gap: 6px; }
.typing-indicator { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text2); }
.typing-dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; animation: typing-bounce 1.2s infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce { 0%,80%,100% { transform: scale(0.7); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } }

.reply-preview { display: flex; align-items: center; justify-content: space-between; background: var(--bg3); border-left: 3px solid var(--accent); border-radius: 4px; padding: 6px 10px; font-size: 0.8rem; color: var(--text2); }

.message-input-row { display: flex; align-items: flex-end; gap: 8px; }
.message-input-wrap { flex: 1; background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 4px 8px; transition: border-color 0.2s; }
.message-input-wrap:focus-within { border-color: var(--accent); }
.message-input { width: 100%; background: none; border: none; color: var(--text); font-size: 0.9rem; outline: none; resize: none; max-height: 150px; line-height: 1.5; padding: 6px 4px; }
.message-input::placeholder { color: var(--text3); }
.file-preview { display: flex; align-items: center; justify-content: space-between; background: rgba(99,102,241,0.1); border-radius: 6px; padding: 4px 8px; margin-bottom: 4px; font-size: 0.75rem; color: var(--accent2); }

.attach-btn { color: var(--text3); font-size: 1.1rem; flex-shrink: 0; }
.attach-btn:hover { color: var(--text); }
.send-btn { width: 36px; height: 36px; border-radius: 8px; background: var(--accent); color: white; display: flex; align-items: center; justify-content: center; transition: background 0.2s, transform 0.1s; flex-shrink: 0; }
.send-btn:hover { background: var(--accent2); }
.send-btn:active { transform: scale(0.95); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Emoji Picker ────────────────────────────────────────────── */
.emoji-picker { position: fixed; z-index: 500; background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 8px; box-shadow: var(--shadow); }
.emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; }
.emoji-opt { width: 32px; height: 32px; border-radius: 6px; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; transition: background 0.15s; }
.emoji-opt:hover { background: var(--bg3); }

/* ── Mention Menu ───────────────────────────────────────────── */
.mention-menu { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 4px; box-shadow: var(--shadow); min-width: 180px; }
.mention-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 0.875rem; transition: background 0.15s; }
.mention-item:hover { background: var(--bg3); }
.mention-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }

/* ── Modals ──────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal::-webkit-scrollbar { width: 4px; }
.modal::-webkit-scrollbar-thumb { background: var(--border2); }
.wide-modal { max-width: 700px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-header button { color: var(--text2); font-size: 1.1rem; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; }
.modal-header button:hover { background: var(--bg3); color: var(--text); }
.modal-body { padding: 20px; }

/* ── Profile Modal ──────────────────────────────────────────── */
.profile-modal-inner { max-width: 360px; overflow: hidden; }
.profile-banner { height: 80px; background: linear-gradient(135deg, var(--accent), var(--purple)); }
.profile-av-wrap { padding: 0 20px; margin-top: -30px; display: flex; align-items: flex-end; justify-content: space-between; }
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; border: 4px solid var(--bg2); object-fit: cover; }
.profile-badges { display: flex; gap: 4px; align-items: center; padding-bottom: 6px; }
.profile-info { padding: 12px 20px 20px; }
.profile-names { margin-bottom: 8px; }
.profile-names h3 { font-size: 1.1rem; font-weight: 700; }
.profile-names span { font-size: 0.8rem; color: var(--text2); }
.profile-bio { font-size: 0.875rem; color: var(--text2); margin-bottom: 10px; }
.profile-meta { font-size: 0.75rem; color: var(--text3); display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.profile-actions { display: flex; gap: 8px; }

/* ── Members Modal ──────────────────────────────────────────── */
.member-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; cursor: pointer; transition: background 0.15s; }
.member-row:hover { background: var(--bg3); }
.member-info { flex: 1; }
.member-name { display: block; font-weight: 500; font-size: 0.875rem; }
.member-role { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.member-role.role-owner { color: var(--yellow); }
.member-role.role-admin { color: var(--red); }
.member-role.role-support { color: var(--green); }
.member-role.role-member { color: var(--text3); }

/* ── Settings Modal ─────────────────────────────────────────── */
.settings-layout { display: flex; gap: 20px; min-height: 400px; padding: 0; }
.settings-nav { width: 140px; flex-shrink: 0; background: var(--bg3); border-right: 1px solid var(--border); padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.snav { text-align: left; padding: 9px 12px; border-radius: 7px; font-size: 0.875rem; font-weight: 500; color: var(--text2); transition: all 0.15s; }
.snav:hover { background: var(--bg4); color: var(--text); }
.snav.active { background: rgba(99,102,241,0.15); color: var(--text); }
.snav.danger-nav { color: var(--red); margin-top: auto; }
.snav.owner-only { color: var(--yellow); }
.settings-content { flex: 1; padding: 20px; overflow-y: auto; }
.settings-content h4 { font-size: 1rem; font-weight: 600; margin-bottom: 16px; }

.avatar-upload-wrap { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.settings-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid var(--border); }

/* ── Group Settings ─────────────────────────────────────────── */
.settings-tabs { display: flex; gap: 4px; background: var(--bg3); border-radius: 8px; padding: 4px; margin-bottom: 20px; }
.stab { flex: 1; padding: 6px; border-radius: 6px; font-size: 0.8rem; font-weight: 500; color: var(--text2); transition: all 0.2s; }
.stab.active { background: var(--bg4); color: var(--text); }
.stab-panel { }
.manage-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 8px; background: var(--bg3); margin-bottom: 6px; font-size: 0.875rem; }
.role-row { gap: 10px; }
.role-select { background: var(--bg4); border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; color: var(--text); font-size: 0.8rem; margin-left: auto; }

/* ── 2FA ─────────────────────────────────────────────────────── */
.tfa-status { background: var(--bg3); border-radius: 8px; padding: 12px; margin-bottom: 16px; font-size: 0.875rem; }
.tfa-on { color: var(--green); font-weight: 500; }
.tfa-off { color: var(--yellow); }
.tfa-methods { display: flex; flex-direction: column; gap: 8px; }
.tfa-method-card { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: all 0.2s; }
.tfa-method-card:hover { border-color: var(--accent); background: var(--bg4); }
.tfa-icon { font-size: 1.5rem; }
.tfa-method-card strong { font-size: 0.9rem; display: block; }
.tfa-method-card small { color: var(--text2); font-size: 0.75rem; }
.tfa-totp-setup { }
.totp-key { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 10px; font-size: 0.85rem; letter-spacing: 2px; text-align: center; margin: 10px 0; word-break: break-all; }
.totp-qr { display: block; margin: 10px auto; border-radius: 8px; border: 4px solid white; }
.tfa-divider { font-size: 0.8rem; text-align: center; color: var(--text3); margin: 12px 0 8px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.tfa-hint { font-size: 0.875rem; color: var(--text2); margin-bottom: 10px; }

/* ── Premium ─────────────────────────────────────────────────── */
.premium-active, .premium-offer { text-align: center; }
.premium-badge-big { font-size: 3rem; margin-bottom: 12px; }
.premium-active h3, .premium-offer h3 { font-size: 1.2rem; margin-bottom: 8px; }
.premium-active p, .premium-offer p { color: var(--text2); margin-bottom: 16px; }
.premium-list { text-align: left; list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 16px 0; padding: 16px; background: var(--bg3); border-radius: 10px; }
.premium-list li { font-size: 0.9rem; color: var(--text2); }

/* ── Owner Panel ─────────────────────────────────────────────── */
.owner-note { color: var(--yellow); font-size: 0.8rem; background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2); border-radius: 6px; padding: 8px 12px; margin-bottom: 16px; }
.owner-user-row { display: flex; align-items: center; justify-content: space-between; padding: 10px; background: var(--bg3); border-radius: 8px; margin-bottom: 6px; font-size: 0.85rem; }
.owner-user-row strong { display: block; }
.owner-user-row small { color: var(--text2); font-size: 0.75rem; }
.owner-user-actions { display: flex; gap: 6px; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge-prem { background: linear-gradient(135deg, var(--accent), var(--purple)); color: white; border-radius: 4px; padding: 1px 6px; font-size: 0.7rem; font-weight: 700; }
.badge-prem-sm { font-size: 0.75rem; }
.badge-owner { font-size: 0.85rem; }
.count { background: var(--bg4); border-radius: 20px; padding: 0 6px; font-size: 0.7rem; font-weight: 600; color: var(--text2); }

/* ── Toast ───────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 16px; font-size: 0.875rem; font-weight: 500; box-shadow: var(--shadow); transform: translateY(10px); opacity: 0; transition: all 0.3s; max-width: 300px; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { border-color: rgba(34,197,94,0.4); }
.toast-error { border-color: rgba(239,68,68,0.4); color: #fca5a5; }
.toast-warn { border-color: rgba(245,158,11,0.4); color: #fcd34d; }

/* ── Loading ─────────────────────────────────────────────────── */
.loading-sm { color: var(--text2); font-size: 0.875rem; padding: 12px 0; }

/* ── Small screen ─────────────────────────────────────────────── */
.mob-only { display: none; }

@media (max-width: 768px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 100; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .channel-sidebar { display: none; }
  .mob-only { display: flex; }
  .main-content { width: 100vw; }
}
