/* ═══════════════════════════════════════════════
   SessionFlow Admin — Chat & Voice Call
   Chat page layout, messages, input bar,
   file attachments, voice call overlay
   ═══════════════════════════════════════════════ */

/* ═══════════════════════════════════════
   CHAT PAGE LAYOUT
   ═══════════════════════════════════════ */

/* When chat page is active, page-content should not scroll or pad */
.page-content.chat-active {
    padding: 0;
    overflow: hidden;
}

#page-chat {
    height: 100%;
}

.chat-page-layout {
    display: flex;
    height: 100%;
    overflow: hidden;
}

.chat-sidebar {
    width: 320px;
    min-width: 280px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    background: rgba(15, 15, 26, 0.5);
}

.chat-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-sidebar-header h3 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Chat Sidebar Tabs */
.chat-sidebar-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 10px;
}

.chat-sidebar-tab {
    flex: 1;
    padding: 6px 0;
    border: none;
    background: none;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-sidebar-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.chat-sidebar-tab.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Group Conversation Item */
.chat-conv-group {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

.chat-conv-group:hover {
    background: rgba(255, 255, 255, 0.03);
}

.chat-conv-group.active {
    background: rgba(99, 102, 241, 0.08);
    border-left: 3px solid var(--accent);
}

.group-conv-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.group-conv-info {
    flex: 1;
    min-width: 0;
}

.group-conv-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.group-conv-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.group-conv-preview {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.group-conv-badge {
    background: var(--accent);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    flex-shrink: 0;
}

/* Group message sender label */
.admin-group-msg-sender {
    font-size: 0.72rem;
    font-weight: 700;
    color: #818cf8;
    margin-bottom: 2px;
    display: block;
}

.admin-msg.msg-sent .admin-group-msg-sender {
    display: none;
}

/* Thread header avatar for group chats */
.chat-avatar.group-chat-avatar {
    background: linear-gradient(135deg, #10b981, #34d399) !important;
}

.chat-search-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.82rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.chat-search-input:focus {
    border-color: var(--accent);
}

.chat-search-input::placeholder {
    color: var(--text-muted);
}

/* Conversation List */
.chat-conv-list {
    flex: 1;
    overflow-y: auto;
}

.chat-conv-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.chat-conv-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.chat-conv-item:hover {
    background: var(--bg-hover);
}

.chat-conv-item.active {
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
}

.chat-conv-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    position: relative;
}

.chat-conv-online {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    border: 2px solid var(--bg-primary);
}

.chat-conv-info {
    flex: 1;
    min-width: 0;
}

.chat-conv-info h4 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-conv-preview {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 2px 0 0;
}

.chat-conv-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.chat-conv-time {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.chat-conv-unread {
    background: var(--accent);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ═══════════════════════════════════════
   CHAT THREAD (Right Panel)
   ═══════════════════════════════════════ */
.chat-thread {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.chat-thread-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 8px;
    color: var(--text-muted);
    text-align: center;
}

.chat-thread-empty h4 {
    margin: 0;
    color: var(--text-secondary);
    font-weight: 600;
}

.chat-thread-empty p {
    margin: 0;
    font-size: 0.82rem;
}

.chat-thread-active {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.chat-thread-active.hidden {
    display: none;
}

.chat-thread-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 15, 26, 0.3);
    flex-shrink: 0;
}

.chat-thread-device {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.chat-thread-device h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.device-avatar {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: #fff;
}

.chat-status {
    font-size: 0.72rem;
    color: var(--success);
}

/* ═══════════════════════════════════════
   CHAT MESSAGES
   ═══════════════════════════════════════ */
.admin-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 0;
}

.chat-msg {
    max-width: 65%;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 0.84rem;
    line-height: 1.45;
    word-wrap: break-word;
    animation: msg-in 0.2s ease-out;
}

.chat-msg-text {
    white-space: pre-wrap;
    word-wrap: break-word;
}

@keyframes msg-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-msg.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-msg.received {
    align-self: flex-start;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.chat-msg-time {
    font-size: 0.62rem;
    opacity: 0.6;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
}

.chat-msg.received .chat-msg-time {
    justify-content: flex-start;
}

.chat-msg-check {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: -3px;
    color: rgba(255, 255, 255, 0.7);
}

.chat-msg-check.read {
    color: #5ee8ff;
    text-shadow: 0 0 4px rgba(94, 232, 255, 0.4);
}

.chat-date-divider {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 8px 0;
    user-select: none;
}

/* ═══════════════════════════════════════
   CHAT INPUT BAR
   ═══════════════════════════════════════ */
.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: rgba(15, 15, 26, 0.3);
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    padding: 10px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 24px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.84rem;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: var(--accent);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

/* Textarea-specific styles for multiline chat input */
textarea.chat-input {
    resize: none;
    overflow-y: hidden;
    min-height: 36px;
    max-height: 120px;
    line-height: 1.4;
    scrollbar-width: none;
    font-family: inherit;
}

textarea.chat-input::-webkit-scrollbar {
    display: none;
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

/* ─── Chat Attach Button ─── */
.chat-attach-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.chat-attach-btn:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

/* File Preview Strip */
.chat-file-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 8px;
    font-size: 0.78rem;
    color: var(--text);
    max-width: 200px;
    overflow: hidden;
}

.chat-file-preview.hidden {
    display: none;
}

.chat-file-preview .file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.chat-file-preview .file-remove {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1;
}

.chat-file-preview .file-remove:hover {
    color: #ef4444;
}

/* File Message Bubble */
.chat-file-bubble {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 4px;
}

.chat-file-bubble img {
    max-width: 220px;
    max-height: 200px;
    border-radius: 8px;
    cursor: pointer;
    object-fit: cover;
}

.chat-file-bubble img:hover {
    opacity: 0.9;
}

.chat-file-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.chat-file-link:hover {
    background: rgba(255, 255, 255, 0.12);
}

.chat-file-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.chat-file-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-file-info .fn {
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-file-info .fs {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════
   VOICE CALL
   ═══════════════════════════════════════ */

/* ─── Call Button in Chat Header ─── */
.call-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.call-btn:hover {
    background: rgba(34, 197, 94, 0.3);
    transform: scale(1.1);
}

/* ─── Call Overlay ─── */
.call-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.call-overlay.hidden {
    display: none;
}

.call-overlay-bg {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 30, 0.92);
    backdrop-filter: blur(20px);
}

.call-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.call-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.call-status {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    margin: 0;
}

.call-timer {
    font-size: 1.8rem;
    font-weight: 300;
    color: #fff;
    font-variant-numeric: tabular-nums;
    margin: 0;
}

.call-timer.hidden {
    display: none;
}

.call-rings {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.call-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(99, 102, 241, 0.3);
    animation: callRing 2s ease-out infinite;
}

.ring-1 {
    width: 90px;
    height: 90px;
    animation-delay: 0s;
}

.ring-2 {
    width: 115px;
    height: 115px;
    animation-delay: 0.4s;
}

.ring-3 {
    width: 140px;
    height: 140px;
    animation-delay: 0.8s;
}

@keyframes callRing {
    0% {
        transform: scale(0.8);
        opacity: 1;
        border-color: rgba(99, 102, 241, 0.6);
    }

    100% {
        transform: scale(1.3);
        opacity: 0;
        border-color: rgba(99, 102, 241, 0);
    }
}

.call-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    z-index: 1;
}

.call-actions {
    display: flex;
    gap: 24px;
    margin-top: 24px;
}

.call-action-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.call-end-btn {
    background: #ef4444;
}

.call-end-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* In-call state — stop ring animation */
.call-overlay.in-call .call-ring {
    animation: none;
    opacity: 0.15;
    transform: scale(1);
}

/* ═══════════════════════════════════════
   REPLY & MENTION STYLES 
   ═══════════════════════════════════════ */

/* Reply Preview Bar (above input) */
.chat-reply-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary, #1e1e2e);
    border-left: 3px solid #6366f1;
    padding: 8px 12px;
    margin: 0 12px 4px;
    border-radius: 8px;
    gap: 10px;
    animation: slideUp 0.2s ease;
}

.chat-reply-bar.hidden {
    display: none;
}

.reply-bar-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.reply-bar-sender {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6366f1;
}

.reply-bar-text {
    font-size: 0.78rem;
    color: var(--text-muted, #94a3b8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-bar-close {
    background: none;
    border: none;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.15s;
}

.reply-bar-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #fff);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Reply Quote inside messages */
.chat-reply-quote {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background 0.15s;
    max-width: 100%;
}

/* Reply quote on SENT (indigo) bubbles — light overlay */
.chat-msg.sent .chat-reply-quote {
    background: rgba(255, 255, 255, 0.18);
    border-left: 3px solid rgba(255, 255, 255, 0.6);
}

.chat-msg.sent .chat-reply-quote:hover {
    background: rgba(255, 255, 255, 0.25);
}

.chat-msg.sent .reply-quote-sender {
    color: rgba(255, 255, 255, 0.95);
}

.chat-msg.sent .reply-quote-text {
    color: rgba(255, 255, 255, 0.7);
}

/* Reply quote on RECEIVED (dark) bubbles — indigo tint */
.chat-msg.received .chat-reply-quote {
    background: rgba(99, 102, 241, 0.15);
    border-left: 3px solid #818cf8;
}

.chat-msg.received .chat-reply-quote:hover {
    background: rgba(99, 102, 241, 0.25);
}

.chat-msg.received .reply-quote-sender {
    color: #a5b4fc;
}

.chat-msg.received .reply-quote-text {
    color: var(--text-secondary, #cbd5e1);
}

.reply-quote-sender {
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
}

.reply-quote-text {
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
    line-height: 1.3;
}

/* Reply Button on messages */
.chat-reply-btn {
    position: absolute;
    top: 4px;
    opacity: 0;
    background: var(--bg-secondary, #1e1e2e);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    font-size: 0.85rem;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
    padding: 0;
    line-height: 1;
}

.chat-msg.sent .chat-reply-btn {
    left: -32px;
}

.chat-msg.received .chat-reply-btn {
    right: -32px;
}

.chat-msg {
    position: relative;
}

.chat-msg:hover .chat-reply-btn {
    opacity: 1;
}

.chat-reply-btn:hover {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
    transform: scale(1.1);
}

/* Message Highlight (when scrolling to reply) */
.chat-msg-highlight {
    animation: msgHighlight 2s ease;
}

@keyframes msgHighlight {

    0%,
    30% {
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.5);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

/* Mention Dropdown */
.mention-dropdown {
    position: absolute;
    bottom: 100%;
    left: 12px;
    right: 12px;
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.15s ease;
}

.mention-dropdown.hidden {
    display: none;
}

.mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.mention-item:hover {
    background: rgba(99, 102, 241, 0.15);
}

.mention-item:first-child {
    border-radius: 10px 10px 0 0;
}

.mention-item:last-child {
    border-radius: 0 0 10px 10px;
}

.mention-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.mention-name {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary, #fff);
}

.mention-status {
    font-size: 0.7rem;
    color: var(--text-muted, #64748b);
}

.mention-status.online {
    color: #10b981;
}

/* Mention Highlight in messages */
.chat-mention {
    color: #818cf8;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.1);
    padding: 1px 3px;
    border-radius: 3px;
}

/* ═══════════════════════════════════════
   CONTEXT MENU
   ═══════════════════════════════════════ */
.chat-context-menu {
    position: fixed;
    z-index: 99999;
    min-width: 170px;
    background: rgba(30, 30, 46, 0.97);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: ctxFadeIn 0.15s ease;
}

@keyframes ctxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-context-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: #cdd6f4;
    font-size: 0.82rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.chat-context-menu button:hover {
    background: rgba(99, 102, 241, 0.15);
}

.chat-context-menu button.ctx-danger {
    color: #f38ba8;
}

.chat-context-menu button.ctx-danger:hover {
    background: rgba(243, 139, 168, 0.12);
}

.ctx-icon {
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
}

/* ═══════════════════════════════════════
   EDIT BAR
   ═══════════════════════════════════════ */
.chat-edit-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
    background: rgba(99, 102, 241, 0.08);
    border-left: 3px solid #6366f1;
    border-radius: 6px 6px 0 0;
    font-size: 0.78rem;
    gap: 8px;
}

.chat-edit-bar.hidden {
    display: none;
}

.edit-bar-content {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.edit-bar-icon {
    font-size: 0.85rem;
}

.edit-bar-label {
    color: #6366f1;
    font-weight: 600;
    white-space: nowrap;
}

.edit-bar-text {
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.edit-bar-close {
    border: none;
    background: transparent;
    color: #888;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.edit-bar-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ef4444;
}

/* ═══════════════════════════════════════
   EDITED LABEL
   ═══════════════════════════════════════ */
.chat-msg-edited {
    font-style: italic;
    font-size: 0.7rem;
    color: #fbbf24;
    margin-right: 4px;
    opacity: 1.7;
    background: rgba(251, 191, 36, 0.1);
    padding: 1px 5px;
    border-radius: 4px;
    letter-spacing: 0.2px;
}