/* css/main.css */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    overflow: hidden;
    height: 100vh;
    transition: background 0.3s, color 0.3s;
}

/* ─── LAYOUT ─── */
.app-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ─── SIDEBAR ─── */
.sidebar {
    width: 280px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    border-right: 1px solid var(--border);
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    z-index: 100;
}

.sidebar-header {
    padding: 18px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.brand-logo {
    width: 36px; height: 36px;
    background: var(--accent-gradient);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: white; flex-shrink: 0;
    box-shadow: 0 4px 12px var(--accent-shadow);
}
.brand-name { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; }
.brand-name em { font-style: normal; color: var(--accent); }

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

/* Glass button */
.glass-btn {
    width: 32px; height: 32px;
    background: var(--glass-btn-bg);
    border: 1px solid var(--glass-border);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
    color: var(--text-muted);
    backdrop-filter: blur(8px);
}
.glass-btn:hover { background: var(--glass-btn-hover); color: var(--text); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.glass-btn:active { transform: translateY(0) scale(0.97); }

/* Search */
.search-section { padding: 12px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.search-wrap { position: relative; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search-input {
    width: 100%;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 9px 12px 9px 36px;
    font-family: inherit; font-size: 13px; color: var(--text);
    outline: none; transition: all 0.2s;
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.search-input::placeholder { color: var(--text-muted); }

.search-results {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px; overflow: hidden;
    box-shadow: var(--shadow-lg);
    display: none; z-index: 200;
}
.search-results.show { display: block; }
.search-result-item {
    padding: 10px 14px; font-size: 13px; cursor: pointer;
    display: flex; align-items: center; gap: 10px;
    transition: background 0.15s;
}
.search-result-item:hover { background: var(--surface-2); }

/* Sidebar scroll */
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 10px 10px 0; }
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 4px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }

/* Nav sections */
.nav-section { margin-bottom: 8px; }
.nav-section-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 6px 4px;
    font-size: 10px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted);
}
.nav-count {
    background: var(--surface-3);
    border-radius: 20px; padding: 1px 7px;
    font-size: 10px; font-weight: 600;
}

.nav-list { display: flex; flex-direction: column; gap: 1px; }

/* Room item */
.room-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    cursor: pointer; transition: all 0.18s;
    position: relative; overflow: hidden;
}
.room-item:hover { background: var(--room-hover); }
.room-item.active { background: var(--room-active); }
.room-item.active::before {
    content: '';
    position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 55%;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.room-avatar {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 700;
    flex-shrink: 0; position: relative;
    color: white;
}
.av-indigo  { background: linear-gradient(135deg,#6366f1,#8b5cf6); }
.av-violet  { background: linear-gradient(135deg,#8b5cf6,#d946ef); }
.av-emerald { background: linear-gradient(135deg,#10b981,#059669); }
.av-rose    { background: linear-gradient(135deg,#f43f5e,#e11d48); }
.av-amber   { background: linear-gradient(135deg,#f59e0b,#ef4444); }
.av-sky     { background: linear-gradient(135deg,#0ea5e9,#6366f1); }
.av-pink    { background: linear-gradient(135deg,#ec4899,#8b5cf6); }
.av-teal    { background: linear-gradient(135deg,#14b8a6,#0ea5e9); }

.status-dot {
    position: absolute; bottom: -1px; right: -1px;
    width: 11px; height: 11px; border-radius: 50%;
    border: 2px solid var(--sidebar-bg);
}
.status-dot.online  { background: #22c55e; }
.status-dot.away    { background: #f59e0b; }
.status-dot.busy    { background: #ef4444; }
.status-dot.offline { background: var(--text-muted); }

.room-info { flex: 1; min-width: 0; }
.room-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 1px; }
.room-preview { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.room-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.room-time { font-size: 10px; color: var(--text-muted); }
.unread-badge {
    background: var(--accent);
    color: white; font-size: 10px; font-weight: 700;
    padding: 2px 6px; border-radius: 20px; min-width: 18px; text-align: center;
}

/* Sidebar footer */
.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 12px 14px;
    display: flex; align-items: center; gap: 10px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
}
.my-avatar {
    width: 34px; height: 34px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800; position: relative;
    color: white;
}
.my-info { flex: 1; min-width: 0; }
.my-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.my-status { font-size: 11px; display: flex; align-items: center; gap: 5px; }
.my-status .dot { width: 6px; height: 6px; border-radius: 50%; }
.my-status.online .dot { background: #22c55e; animation: pulse-dot 2s infinite; }
.my-status.away .dot   { background: #f59e0b; }
.my-status.busy .dot   { background: #ef4444; }
@keyframes pulse-dot { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(0.8)} }

/* ─── CHAT MAIN ─── */
.chat-main {
    flex: 1; display: flex; flex-direction: column;
    height: 100vh; min-width: 0;
    background: var(--bg-base);
}

/* Chat header */
.chat-header {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    flex-shrink: 0; z-index: 10;
}
.chat-room-avatar { width: 40px; height: 40px; border-radius: 11px; font-size: 18px; display: flex; align-items: center; justify-content: center; color: white; flex-shrink: 0; }
.chat-room-name { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; }
.chat-room-desc { font-size: 12px; color: var(--text-muted); }
.chat-header-actions { display: flex; gap: 6px; margin-left: auto; }

/* Messages area */
.messages-area {
    flex: 1; overflow-y: auto;
    padding: 20px 24px;
    display: flex; flex-direction: column;
    gap: 2px;
}
.messages-area::-webkit-scrollbar { width: 5px; }
.messages-area::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 4px; }
.messages-area::-webkit-scrollbar-track { background: transparent; }

/* Date divider */
.date-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 20px 0 10px;
}
.date-divider::before, .date-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.date-text { font-size: 11px; color: var(--text-muted); font-weight: 600; white-space: nowrap; padding: 4px 10px; background: var(--surface-2); border-radius: 20px; }

/* Message group */
.msg-group { margin-bottom: 14px; }
.msg-row { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 2px; }
.msg-row.self { flex-direction: row-reverse; }

.msg-avatar {
    width: 28px; height: 28px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 800; flex-shrink: 0;
    align-self: flex-end; color: white;
}

.msg-content { max-width: 68%; display: flex; flex-direction: column; gap: 2px; }
.msg-row.self .msg-content { align-items: flex-end; }

.msg-sender { font-size: 11px; color: var(--text-muted); margin-bottom: 3px; font-weight: 600; padding-left: 2px; }

.msg-bubble {
    background: var(--bubble-bg);
    border: 1px solid var(--bubble-border);
    border-radius: 16px 16px 16px 4px;
    padding: 10px 14px;
    font-size: 14px; line-height: 1.55;
    word-break: break-word;
    position: relative;
    transition: background 0.2s;
}
.msg-row.self .msg-bubble {
    background: var(--accent);
    border-color: transparent;
    border-radius: 16px 16px 4px 16px;
    color: white;
}
.msg-bubble:hover { background: var(--bubble-hover); }
.msg-row.self .msg-bubble:hover { background: var(--accent-dark); }

.msg-time { font-size: 10px; color: var(--text-muted); padding: 0 2px; font-family: 'Fira Code', monospace; }
.msg-row.self .msg-time { text-align: right; }

/* Reply preview */
.msg-reply {
    background: var(--surface-2);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 6px 10px;
    margin-bottom: 4px;
    font-size: 12px; color: var(--text-muted);
    cursor: pointer;
}
.msg-reply strong { color: var(--accent); font-size: 11px; }

/* Reactions */
.msg-reactions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; padding: 0 2px; }
.reaction-chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px; padding: 3px 8px;
    font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.reaction-chip:hover { border-color: var(--accent); transform: scale(1.06); }
.reaction-chip.mine { background: var(--accent-ring); border-color: var(--accent); }
.reaction-count { font-size: 11px; color: var(--text-muted); font-weight: 600; }

/* File / Image messages */
.file-bubble {
    display: flex; align-items: center; gap: 12px;
    background: var(--bubble-bg);
    border: 1px solid var(--bubble-border);
    border-radius: 14px; padding: 12px 14px;
    cursor: pointer; transition: all 0.2s; max-width: 280px;
}
.file-bubble:hover { border-color: var(--accent); }
.file-bubble-icon {
    width: 42px; height: 42px;
    background: var(--accent-ring);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.file-bubble-icon svg { color: var(--accent); }
.file-bubble-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.file-bubble-size { font-size: 11px; color: var(--text-muted); }

.img-bubble { border-radius: 14px; overflow: hidden; max-width: 280px; cursor: pointer; border: 1px solid var(--border); position: relative; }
.img-bubble img { display: block; width: 100%; max-height: 220px; object-fit: cover; }
.img-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0); display: flex; align-items: center; justify-content: center; opacity: 0; transition: all 0.2s; }
.img-bubble:hover .img-overlay { background: rgba(0,0,0,0.35); opacity: 1; }

/* System messages */
.msg-system { text-align: center; font-size: 12px; color: var(--text-muted); padding: 4px 0; font-style: italic; }

/* Typing indicator */
.typing-row { display: flex; align-items: center; gap: 10px; padding: 2px 0; }
.typing-bubble { background: var(--bubble-bg); border: 1px solid var(--bubble-border); border-radius: 16px 16px 16px 4px; padding: 10px 16px; display: flex; gap: 4px; align-items: center; }
.typing-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: type-bounce 1.4s ease infinite; }
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes type-bounce { 0%,60%,100%{transform:translateY(0);opacity:.4} 30%{transform:translateY(-5px);opacity:1} }

/* ─── INPUT AREA ─── */
.input-area {
    padding: 14px 20px 18px;
    border-top: 1px solid var(--border);
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    flex-shrink: 0;
}

.file-preview-bar {
    display: none; align-items: center; gap: 10px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 10px; padding: 8px 12px; margin-bottom: 10px;
    font-size: 13px;
}
.file-preview-bar.show { display: flex; }
.file-preview-bar svg { color: var(--accent); flex-shrink: 0; }
.fp-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-remove { cursor: pointer; color: var(--text-muted); display: flex; align-items: center; border: none; background: none; transition: color 0.2s; }
.fp-remove:hover { color: #ef4444; }

.reply-bar {
    display: none; align-items: center; gap: 10px;
    background: var(--surface-2); border-left: 3px solid var(--accent);
    border-radius: 8px; padding: 8px 12px; margin-bottom: 10px;
    font-size: 12px; color: var(--text-muted);
}
.reply-bar.show { display: flex; }
.reply-bar strong { color: var(--accent); }
.reply-close { margin-left: auto; cursor: pointer; background: none; border: none; color: var(--text-muted); display: flex; align-items: center; }
.reply-close:hover { color: var(--text); }

.input-toolbar { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.tool-btn {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); padding: 5px 7px;
    border-radius: 7px; transition: all 0.18s;
    display: flex; align-items: center; gap: 4px;
    font-family: inherit; font-size: 12px; font-weight: 600;
}
.tool-btn:hover { color: var(--accent); background: var(--accent-ring); }
.tool-btn svg { width: 16px; height: 16px; }
.tool-sep { width: 1px; height: 18px; background: var(--border); margin: 0 2px; }

.input-row { display: flex; align-items: flex-end; gap: 10px; }
.msg-input-box {
    flex: 1; display: flex; align-items: flex-end; gap: 8px;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: 14px; padding: 10px 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.msg-input-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }

.msg-textarea {
    flex: 1; background: none; border: none; outline: none;
    font-family: inherit; font-size: 14px; color: var(--text);
    resize: none; max-height: 120px; line-height: 1.5;
}
.msg-textarea::placeholder { color: var(--text-muted); }

.send-btn {
    width: 42px; height: 42px;
    background: var(--accent-gradient);
    border: none; border-radius: 12px;
    color: white; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; flex-shrink: 0;
    box-shadow: 0 4px 12px var(--accent-shadow);
}
.send-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px var(--accent-shadow); }
.send-btn:active { transform: scale(0.96); }

/* ─── MEMBERS PANEL ─── */
.members-panel {
    width: 230px; min-width: 230px;
    background: var(--sidebar-bg);
    border-left: 1px solid var(--border);
    height: 100vh; overflow-y: auto;
    padding: 18px 12px;
    backdrop-filter: blur(20px);
}
.members-panel::-webkit-scrollbar { width: 4px; }
.members-panel::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 4px; }
.members-section-title { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; padding: 0 6px; }
.member-chip {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 8px; border-radius: 9px; cursor: pointer;
    transition: background 0.15s; margin-bottom: 1px;
}
.member-chip:hover { background: var(--room-hover); }
.member-av { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: white; flex-shrink: 0; position: relative; }
.member-av .status-dot { width: 9px; height: 9px; }
.member-name { font-size: 13px; font-weight: 500; }
.member-role-badge { font-size: 9px; font-weight: 700; color: var(--accent); letter-spacing: 0.5px; }
.members-group { margin-bottom: 18px; }

/* ─── EMOJI PICKER ─── */
.emoji-wrap { position: relative; }
.emoji-picker {
    position: absolute; bottom: calc(100% + 10px); left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px; padding: 14px;
    width: 300px; display: none;
    box-shadow: var(--shadow-xl); z-index: 500;
    animation: slideUp 0.18s ease;
}
.emoji-picker.show { display: block; }
@keyframes slideUp { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.emoji-cats { display: flex; gap: 4px; margin-bottom: 10px; }
.emoji-cat-btn { flex: 1; background: none; border: none; font-size: 16px; padding: 4px; border-radius: 6px; cursor: pointer; transition: background 0.15s; }
.emoji-cat-btn:hover,.emoji-cat-btn.active { background: var(--surface-2); }
.emoji-grid { display: grid; grid-template-columns: repeat(8,1fr); gap: 2px; }
.emoji-cell { font-size: 20px; padding: 5px; text-align: center; border-radius: 6px; cursor: pointer; transition: background 0.15s; }
.emoji-cell:hover { background: var(--surface-2); transform: scale(1.15); }

/* ─── MODALS ─── */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; opacity: 0; pointer-events: none;
    transition: opacity 0.2s; padding: 20px;
}
.modal-backdrop.show { opacity: 1; pointer-events: all; }
.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px; padding: 32px;
    width: 100%; max-width: 440px;
    transform: scale(0.95) translateY(8px);
    transition: transform 0.25s;
    box-shadow: var(--shadow-xl);
    max-height: 90vh; overflow-y: auto;
}
.modal-backdrop.show .modal { transform: scale(1) translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-size: 20px; font-weight: 800; letter-spacing: -0.3px; }
.modal-close { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted); transition: all 0.2s; }
.modal-close:hover { background: var(--surface-3); color: var(--text); }

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.8px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 7px; }
.form-input {
    width: 100%;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: 11px;
    padding: 11px 14px;
    font-family: inherit; font-size: 14px; color: var(--text);
    outline: none; transition: all 0.2s;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.form-input::placeholder { color: var(--text-muted); }
textarea.form-input { resize: vertical; min-height: 80px; }

.type-selector { display: flex; gap: 8px; }
.type-opt {
    flex: 1; padding: 10px;
    background: var(--surface-2); border: 1.5px solid var(--border);
    border-radius: 11px; text-align: center;
    cursor: pointer; transition: all 0.2s; font-size: 13px; font-weight: 600;
}
.type-opt:hover { border-color: var(--accent); }
.type-opt.selected { background: var(--accent-ring); border-color: var(--accent); color: var(--accent); }
.type-opt-icon { font-size: 20px; display: block; margin-bottom: 4px; }

.icon-grid { display: grid; grid-template-columns: repeat(8,1fr); gap: 4px; }
.icon-cell { font-size: 20px; padding: 6px; text-align: center; border-radius: 7px; cursor: pointer; border: 1.5px solid transparent; transition: all 0.15s; }
.icon-cell:hover { background: var(--surface-2); }
.icon-cell.selected { border-color: var(--accent); background: var(--accent-ring); }

.modal-actions { display: flex; gap: 10px; margin-top: 24px; }
.btn-primary {
    flex: 1; padding: 12px;
    background: var(--accent-gradient);
    border: none; border-radius: 11px;
    color: white; font-family: inherit; font-size: 14px; font-weight: 700;
    cursor: pointer; transition: all 0.2s;
    box-shadow: 0 4px 12px var(--accent-shadow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px var(--accent-shadow); }
.btn-secondary {
    padding: 12px 18px;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: 11px;
    color: var(--text-muted); font-family: inherit; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.btn-secondary:hover { background: var(--surface-3); color: var(--text); }

/* ─── TOAST ─── */
.toast {
    position: fixed; bottom: 24px; left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px; padding: 12px 20px;
    font-size: 13px; font-weight: 500;
    z-index: 9999; transition: transform 0.3s cubic-bezier(.34,1.56,.64,1);
    box-shadow: var(--shadow-xl);
    display: flex; align-items: center; gap: 8px;
    white-space: nowrap; pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(34,197,94,0.4); }
.toast.error { border-color: rgba(239,68,68,0.4); }

/* ─── IMAGE LIGHTBOX ─── */
.lightbox {
    position: fixed; inset: 0; background: rgba(0,0,0,0.9);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.lightbox.show { opacity: 1; pointer-events: all; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 12px; object-fit: contain; }
.lightbox-close { position: absolute; top: 20px; right: 20px; width: 40px; height: 40px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: white; transition: all 0.2s; }
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ─── NOISE TEXTURE ─── */
.noise-overlay {
    position: fixed; inset: 0; z-index: 9998; pointer-events: none; opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 128px;
}

/* Context menu */
.ctx-menu {
    position: fixed; background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px; padding: 6px;
    box-shadow: var(--shadow-xl);
    z-index: 800; display: none; min-width: 160px;
    animation: ctxIn 0.15s ease;
}
@keyframes ctxIn { from{opacity:0;transform:scale(.95)} to{opacity:1;transform:scale(1)} }
.ctx-menu.show { display: block; }
.ctx-item { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; transition: background 0.15s; }
.ctx-item:hover { background: var(--surface-2); }
.ctx-item.danger { color: #ef4444; }
.ctx-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.ctx-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* Hamburger */
.hamburger { display: none; }

/* Loading skeleton */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: skeleton-wave 1.5s infinite; border-radius: 8px; }
@keyframes skeleton-wave { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* Welcome screen */
.welcome-screen { flex: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 16px; color: var(--text-muted); }
.welcome-icon { font-size: 64px; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
.welcome-title { font-size: 22px; font-weight: 700; color: var(--text); }
.welcome-sub { font-size: 14px; text-align: center; max-width: 300px; line-height: 1.6; }

/* Notification badge */
.notif-badge {
    position: absolute; top: -3px; right: -3px;
    min-width: 16px; height: 16px; background: #ef4444;
    border-radius: 20px; font-size: 9px; font-weight: 700; color: white;
    display: flex; align-items: center; justify-content: center; padding: 0 4px;
    border: 2px solid var(--sidebar-bg);
}

/* Status selector dropdown */
.status-menu { position: absolute; bottom: calc(100% + 8px); left: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px; box-shadow: var(--shadow-xl); z-index: 300; display: none; min-width: 160px; }
.status-menu.show { display: block; }
.status-opt { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; transition: background 0.15s; }
.status-opt:hover { background: var(--surface-2); }
