/* ═══════════════════════ Fonte (Inter) ═══════════════════════ */
body,
button,
input,
select,
textarea {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
}

/* ═══════════════════════ Scrollbars ═══════════════════════ */
.custom-scrollbar::-webkit-scrollbar,
.conversations-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track,
.conversations-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb,
.conversations-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(100, 116, 139, 0.25);
    border-radius: 6px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover,
.conversations-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(100, 116, 139, 0.4);
}

/* Scrollbar fina da lista de conversas (4px) */
.conversations-scrollbar::-webkit-scrollbar { width: 4px; }
.conversations-scrollbar::-webkit-scrollbar-thumb { background-color: transparent; }
.conversations-scrollbar:hover::-webkit-scrollbar-thumb { background-color: rgba(156, 163, 175, 0.6); }
.dark .conversations-scrollbar:hover::-webkit-scrollbar-thumb { background-color: rgba(96, 165, 250, 0.7); }

.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* Scrollbar discreta do modal de figurinhas (fina, aparece só no hover) */
#stickers-list::-webkit-scrollbar { width: 4px; height: 4px; }
#stickers-list::-webkit-scrollbar-track { background: transparent; }
#stickers-list::-webkit-scrollbar-thumb { background-color: transparent; border-radius: 6px; }
#stickers-list:hover::-webkit-scrollbar-thumb { background-color: rgba(148, 163, 184, 0.45); }
.dark #stickers-list:hover::-webkit-scrollbar-thumb { background-color: rgba(96, 165, 250, 0.55); }
#stickers-list { scrollbar-width: thin; scrollbar-color: transparent transparent; }
#stickers-list:hover { scrollbar-color: rgba(148, 163, 184, 0.45) transparent; }
.dark #stickers-list:hover { scrollbar-color: rgba(96, 165, 250, 0.55) transparent; }

/* ═══════════════════════ Lista de conversas (scroll) ═══════════════════════ */
.list-pane {
    overflow-y: auto;
    overflow-x: hidden;
}
.list-pane::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.list-pane::-webkit-scrollbar-track {
    background: transparent;
}
.list-pane::-webkit-scrollbar-thumb {
    background-color: rgba(100, 116, 139, 0.25);
    border-radius: 6px;
}

/* ═══════════════════════ Abas (Atendendo/Aguardando/Finalizados) ═══════════════════════ */
.tab-btn.active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.5);
}
.dark .tab-btn.active {
    background: #334155;
    color: #60a5fa;
    border-color: #475569;
}
.tab-btn:not(.active) {
    color: #94a3b8;
}
.dark .tab-btn:not(.active) { color: #94a3b8; }

/* ═══════════════════════ Card de ticket (igual ao React) ═══════════════════════ */
.ticket-item {
    transition: background 0.15s;
}
.ticket-item:hover {
    background: #f1f5f9; /* slate-100 */
}
.ticket-item.selected {
    background-color: #fafbff !important;
}
.list-pane .ticket-item:nth-child(even) {
    background-color: #fafbff;
}
.dark .ticket-item {
    background: #1f2937; /* gray-800 */
}
.dark .ticket-item:hover {
    background: #374151;
}
.dark .ticket-item.selected {
    background-color: #1f2937 !important;
}
.dark .list-pane .ticket-item:nth-child(even) {
    background-color: #1f2937;
}

/* Tags do card (pill) */
.tag-base {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    border: 1px solid rgba(0, 0, 0, 0.05);
}
.dark .tag-base {
    border-color: rgba(255, 255, 255, 0.08);
}

/* ═══════════════════════ Botões de ação da barra (w-8 h-8) ═══════════════════════ */
.action-btn {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid;
    transition: all 0.15s;
}

/* ═══════════════════════ Animações dos botões de ação (igual original) ═══════════════════════ */
.icon-button-animate {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.icon-button-animate:hover {
    transform: scale(1.15) translateY(-2px);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}
.icon-button-animate:active {
    transform: scale(0.95);
}

/* Menu (hamburger) - Bounce */
.icon-menu-animate:hover {
    animation: menuBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes menuBounce {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.2) rotate(-5deg); }
    50% { transform: scale(1.25) rotate(5deg); }
    75% { transform: scale(1.15); }
}

/* Chat - Pulse */
.icon-chat-animate:hover {
    animation: chatPulse 0.6s ease-in-out;
}
@keyframes chatPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Grupos - Saltadinha (mesma do Chat) */
.icon-groups-animate:hover {
    animation: chatPulse 0.6s ease-in-out;
}

/* Filtro - Saltadinha (mesma do Chat) */
.icon-filter-animate:hover {
    animation: chatPulse 0.6s ease-in-out;
}

/* Add (Plus) - Saltadinha (mesma do Chat) */
.icon-add-animate:hover {
    animation: chatPulse 0.6s ease-in-out;
}

/* Glow effect para badges */
.badge-glow {
    animation: badgeGlow 1.5s ease-in-out infinite;
}
@keyframes badgeGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* Animação slideInLeft do overlay de contato */
@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ═══════════════════════ Menu glass (dropdowns) ═══════════════════════ */
.glass-menu {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.6);
}
.glass-menu.dark, .dark .glass-menu {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.menu-item {
    transition: all 0.15s;
}
.menu-item:hover {
    transform: translateX(3px);
}

.icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    flex-shrink: 0;
    transition: all 0.15s;
}
.menu-item:hover .icon-box {
    color: #fff !important;
    background: inherit;
}

.icon-box-emerald { background: rgba(16, 185, 129, 0.1); color: #059669; }
.icon-box-emerald:hover { background: #059669; }
.menu-item:hover .icon-box-emerald { background: #059669; }
.menu-item-text-emerald { color: #059669; }
.dark .menu-item-text-emerald { color: #34d399; }

.icon-box-red { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.menu-item:hover .icon-box-red { background: #dc2626; }
.menu-item-text-red { color: #dc2626; }
.dark .menu-item-text-red { color: #f87171; }

.menu-divider {
    height: 1px;
    margin: 4px 8px;
}

@keyframes menuIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.menu-appear {
    animation: menuIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Menu dropdown do navbar / perfil */
.menu-dropdown-item,
.profile-menu-item {
    transition: all 0.15s;
}
.menu-dropdown-item:hover,
.profile-menu-item:hover {
    background: rgba(59, 130, 246, 0.08);
    transform: translateX(4px);
}
.dark .menu-dropdown-item:hover,
.dark .profile-menu-item:hover {
    background: rgba(59, 130, 246, 0.15);
}
.menu-dropdown-item:hover i,
.profile-menu-item:hover i {
    transform: scale(1.1);
}

.nav-section-button {
    transition: all 0.15s;
}
.nav-section-button:hover {
    transform: translateY(-1px);
}
.nav-section-button:hover i {
    transform: scale(1.1);
}
.nav-section-button.is-open {
    color: #2563eb;
    background: #eff6ff;
}
.dark .nav-section-button.is-open {
    background: #374151;
    color: #60a5fa;
}

.profile-group:hover .avatar-container {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

#messages-list,
#visualizer-messages {
    overflow-y: auto;
    overflow-x: hidden;
}

/* ═══════════════════════ Bolhas de mensagem ═══════════════════════ */
/* Igual ao original (MessagesList): linha com text-align, balão inline-block */
.msg-row {
    text-align: right;
    position: relative;
    margin: 4px 0;
}
.msg-row.from-other { text-align: left; }

/* Contêiner interno (balão + botão ⋯) — inline-block, sem flex/estiramento */
.msg-inner {
    display: inline-block;
    position: relative;
    text-align: left;
    vertical-align: bottom;
    max-width: 85%;
}

.msg-bubble {
    max-width: 600px;
    width: fit-content;
    height: auto;
    min-height: 0;
    padding: 8px 12px 8px 8px;
    border-radius: 18px;
    font-size: 13.5px;
    line-height: 1.35;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(0, 0, 0, 0.06);
    position: relative;
}
/* O balão NÃO preserva quebras de linha: o template JS tem newlines/indentação
   entre os elementos, e `pre-line` no balão virava linhas vazias (balão esticado).
   A preservação de quebras fica só no conteúdo do texto.
   O padding replica o textContentItem original (3px 50px 6px 6px); usamos 60px
   à direita porque a hora e os vistos ficam juntos dentro do timestamp. */
.msg-bubble .msg-text {
    white-space: pre-line;
    padding: 3px 60px 6px 6px;
}
.msg-bubble .msg-body-text {
    white-space: pre-line;
}
.msg-bubble:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* Meu balão (enviado) — azul claro #e3f2fd (Material Blue 50) */
.from-me .msg-bubble {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    color: #1f2937;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 0;
}
/* Balão do cliente (recebido) — branco */
.from-other .msg-bubble {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #1f2937;
    border-top-left-radius: 0;
    border-top-right-radius: 18px;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
}
.dark .from-me .msg-bubble {
    background: #1e3a8a;
    border-color: #3b82f6;
    color: #dbeafe;
}
.dark .from-other .msg-bubble {
    background: #374151;
    border-color: #374151;
    color: #f9fafb;
}

/* Balão só de mídia (imagem SEM legenda) — sem padding/borda */
.msg-bubble.media-bubble {
    padding: 0;
    max-width: 320px;
    min-width: 0;
    width: fit-content;
    display: inline-block;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 12px;
    overflow: hidden;
}
.msg-bubble.media-bubble:hover { box-shadow: none; }
.dark .msg-bubble.media-bubble { background: transparent; border: none; }

/* Container de botões do WhatsApp */
.msg-bubble.media-bubble .buttons-container {
    width: 100%;
    max-width: 520px;
    min-width: 250px;
    margin: 0;
}
.msg-bubble.media-bubble .buttons-container .btn-body {
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    color: #1f2937;
}
.dark .msg-bubble.media-bubble .buttons-container .btn-body { color: #e5e7eb; }
.msg-bubble.media-bubble .buttons-container .btn-header {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
    color: #111827;
}
.dark .msg-bubble.media-bubble .buttons-container .btn-header { color: #f9fafb; }
.msg-bubble.media-bubble .buttons-container .btn-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 8px 0;
}
.dark .msg-bubble.media-bubble .buttons-container .btn-divider { background: rgba(255, 255, 255, 0.15); }
.msg-bubble.media-bubble .buttons-container .btn-footer {
    font-size: 12px;
    margin-top: 6px;
    opacity: 0.7;
    color: #4b5563;
}
.dark .msg-bubble.media-bubble .buttons-container .btn-footer { color: #d1d5db; }
.msg-bubble.media-bubble .buttons-container .btn-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.msg-bubble.media-bubble .buttons-container .btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #2563eb;
    color: #2563eb;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.dark .msg-bubble.media-bubble .buttons-container .btn { background: #1f2937; color: #60a5fa; border-color: #3b82f6; }
.msg-bubble.media-bubble .buttons-container .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #eff6ff;
}
.dark .msg-bubble.media-bubble .buttons-container .btn:hover { background: #374151; }
.msg-bubble.media-bubble .buttons-container .btn:disabled { opacity: 0.6; cursor: not-allowed; }
/* Botão de lista */
.msg-bubble.media-bubble .buttons-container .btn-list .btn {
    text-align: left;
    border-radius: 8px;
    padding: 12px 16px;
}
.msg-bubble.media-bubble .buttons-container .btn-list .btn:hover { transform: translateX(2px); }
.msg-bubble.media-bubble .buttons-container .btn-list .btn-title { font-weight: 600; font-size: 14px; }
.msg-bubble.media-bubble .buttons-container .btn-list .btn-desc { font-size: 12px; opacity: 0.8; margin-top: 2px; }


/* Balão de mídia COM legenda — vira balão normal, imagem no topo */
.msg-bubble.media-caption-bubble {
    padding: 0;
    max-width: 320px;
    min-width: 0;
    width: fit-content;
}
.msg-bubble.media-caption-bubble .media-img,
.msg-bubble.media-caption-bubble .media-video {
    border-radius: 17px 17px 0 0;
}
.msg-bubble.media-caption-bubble .media-caption {
    padding: 8px 10px 2px;
    max-width: 320px;
    white-space: pre-line;
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.3;
}
.msg-bubble.media-caption-bubble .media-caption-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding: 2px 10px 8px;
    color: #6b7280;
    font-size: 11px;
    opacity: 1;
}
.dark .msg-bubble.media-caption-bubble .media-caption-footer { color: #d1d5db; }

.msg-bubble img.media-img {
    display: block;
    max-width: 320px;
    max-height: 320px;
    object-fit: cover;
    border-radius: 12px;
}
.msg-bubble video.media-video {
    display: block;
    max-width: 320px;
    max-height: 320px;
    border-radius: 12px;
}

/* Mini-badge de horário sobre a imagem */
.media-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(17, 24, 39, 0.78);
    color: #ffffff;
    padding: 4px 7px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1;
    font-weight: 500;
    z-index: 10;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 22px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(2px);
}
.media-badge .msg-ack { color: #fff; font-weight: 800; }
.media-badge .msg-ack.ack-blue { color: #60a5fa; font-weight: 800; }
.media-badge .media-ack { color: #fff; font-weight: 800; }
.media-badge .media-ack.ack-blue { color: #60a5fa; font-weight: 800; }

/* Legenda de imagem (com horário abaixo) */
.media-caption {
    padding: 8px 10px 10px 10px;
    max-width: 320px;
    white-space: pre-line;
    overflow-wrap: anywhere;
    font-size: 13px;
    line-height: 1.3;
}
.media-caption-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 8px;
    padding-right: 8px;
    color: #6b7280;
    font-size: 11px;
    opacity: 0.9;
}
.dark .media-caption-footer { color: #d1d5db; }

/* Timestamp do texto (dentro do balão, rodapé absoluto) */
.msg-time {
    position: absolute;
    bottom: 4px;
    right: 8px;
    font-size: 11px;
    color: #6b7280;
    font-weight: 400;
    opacity: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.dark .msg-time { color: #9ca3af; }

.msg-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 2px;
    font-size: 10.5px;
}
.msg-ack { display: inline-flex; align-items: center; color: #6b7280; opacity: 0.85; }
.msg-ack.ack-blue { color: #0377fc; opacity: 1; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15)); }
.dark .msg-ack.ack-blue { color: #7cb8ff; opacity: 1; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25)); }

/* Botão ⋯ de ações da mensagem (surge no hover, junto ao balão) */
.msg-inner .msg-actions-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #999;
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    padding: 4px;
    transition: color 0.15s, opacity 0.15s;
}
.msg-row.from-other .msg-inner .msg-actions-btn { right: -30px; }
.msg-row.from-me .msg-inner .msg-actions-btn { left: -30px; }
.msg-row:hover .msg-actions-btn {
    opacity: 1;
    pointer-events: auto;
}
.msg-actions-btn:hover { color: #555; }

/* Preview de "Resposta ao seu Status" (translúcido/esfumaçado, tipo sombra) */
.status-reply-preview { background: transparent; box-shadow: 0 4px 14px rgba(0,0,0,0.12); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); border-color: rgba(75,85,99,0.5); }
.dark .status-reply-preview { background: transparent; box-shadow: 0 4px 14px rgba(0,0,0,0.4); }
.status-reply-preview img,
.status-reply-preview video,
.status-reply-preview audio { display: block; margin-top: 6px; }

/* Preview de localização (card do mapa) */
.location-preview .loc-img-error { display: none; }

/* Rótulo "Encaminhada" no balão */
.msg-forwarded {
    font-size: 11px;
    font-style: italic;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
    font-weight: 600;
}
.dark .msg-forwarded { color: #7c8ba1; }

/* Checkbox de seleção múltipla de mensagens */
.msg-row.selectable { cursor: pointer; }
.msg-row.selectable:hover .msg-bubble { outline: 2px solid rgba(66, 135, 245, 0.4); }
.select-msg-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 12;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(66, 135, 245, 0.6);
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 11px;
    color: transparent;
}
.msg-row.from-me .select-msg-checkbox { left: auto; right: 8px; }
.select-msg-checkbox.checked {
    background: #4287f5;
    border-color: #4287f5;
    color: #fff;
}
.dark .select-msg-checkbox { background: #1e293b; border-color: rgba(96, 165, 250, 0.6); }
.dark .select-msg-checkbox.checked { background: #3b82f6; border-color: #3b82f6; color: #fff; }

/* Reações */
.msg-inner .msg-reactions {
    position: absolute;
    bottom: -18px;
    z-index: 11;
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 16px;
    padding: 1px 6px;
    font-size: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.msg-row.from-other .msg-inner .msg-reactions { left: 10px; }
.msg-row.from-me .msg-inner .msg-reactions { right: 10px; }
.dark .msg-reactions { background: #1e293b; border-color: rgba(255, 255, 255, 0.15); }
/* Emojis Apple nas reações do balão */
.msg-inner .msg-reactions .epr-emoji,
.msg-inner .msg-reactions img {
    width: 1.25em;
    height: 1.25em;
    display: inline-block;
    vertical-align: -0.2em;
}

/* Mensagem favorita: estrela no canto do balão */
.msg-inner .msg-fav {
    position: absolute;
    top: 4px;
    z-index: 1;
    color: #fbbf24;
    font-size: 12px;
}
.msg-row.from-other .msg-inner .msg-fav { right: 4px; }
.msg-row.from-me .msg-inner .msg-fav { left: 4px; }

/* vCard */
.vcard-card {
    min-width: 280px;
    max-width: 320px;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.dark .vcard-card { background: #1f2937; border-color: #374151; }

/* Preview de resposta (reply) */
.reply-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: #f1f5f9;
    border-left: 4px solid #3b82f6;
}
.dark .reply-preview { background: #1f2937; border-left-color: #60a5fa; }

/* Menu de opções da mensagem */
.msg-menu {
    position: fixed;
    z-index: 9999;
    min-width: 160px;
    padding: 6px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 20px 25px -5px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.01);
}
.dark .msg-menu { background: #1e293b; border-color: #334155; }
.msg-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    margin: 2px 0;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #475569;
    cursor: pointer;
    text-align: left;
    background: transparent;
    border: none;
    transition: all 0.15s;
}
.dark .msg-menu-item { color: #cbd5e1; }
.msg-menu-item:hover { background: #f1f5f9; color: #1e293b; }
.msg-menu-item .msg-menu-icon { font-size: 16px; opacity: 0.6; width: 18px; text-align: center; }
.msg-menu-item:hover .msg-menu-icon { transform: scale(1.1); }
.msg-menu-item.copiar:hover { background: #ede9fe; color: #7c3aed; }
.msg-menu-item.responder:hover { background: #fef8f0; color: #ea580c; }
.msg-menu-item.reagir:hover { background: #eff6ff; color: #2563eb; }
.msg-menu-item.favoritar:hover { background: #fef3c7; color: #d97706; }
.msg-menu-item.encaminhar:hover { background: #eff6ff; color: #2563eb; }
.msg-menu-item.deletar:hover { background: #fef2f2; color: #ef4444; }
.msg-menu-item.editar:hover { background: #f0fdf4; color: #16a34a; }
.msg-menu-item.fixar:hover { background: #eff6ff; color: #2563eb; }

/* ═══════════════ LanguageTool (corretor) ═══════════════ */
.language-tool-popover {
    position: absolute;
    z-index: 99999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    animation: ltFadeZoomIn 0.2s ease;
}
@keyframes ltFadeZoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
/* Layout vertical (lista) */
.language-tool-popover.vertical-layout {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    width: 180px;
    padding: 8px;
}
.language-tool-popover[data-theme="dark"].vertical-layout {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}
.popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    margin-bottom: 4px;
}
.popover-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #cbd5e1;
}
.popover-close,
.close-btn {
    background: none;
    border: none;
    padding: 2px 4px;
    cursor: pointer;
    color: #cbd5e1;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    border-radius: 6px;
}
.popover-close:hover, .close-btn:hover { color: #64748b; background: rgba(100,116,139,0.1); }
.language-tool-popover[data-theme="dark"] .popover-close:hover,
.language-tool-popover[data-theme="dark"] .close-btn:hover { color: #94a3b8; }
.suggestions-list { display: flex; flex-direction: column; gap: 2px; }
.suggestion-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}
.suggestion-item:hover {
    background: rgba(59, 130, 246, 0.08);
    color: #2563eb;
    transform: translateX(4px);
}
.language-tool-popover[data-theme="dark"] .suggestion-item { color: #cbd5e1; }
.language-tool-popover[data-theme="dark"] .suggestion-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #60a5fa;
}
.indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: transparent;
    flex-shrink: 0;
}
.indicator.active { background: #3b82f6; }
.popover-footer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.language-tool-popover[data-theme="dark"] .popover-footer { border-top-color: rgba(255, 255, 255, 0.05); }
.ignore-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #cbd5e1;
    cursor: pointer;
    transition: color 0.2s ease;
}
.ignore-btn:hover { color: #2563eb; }
.language-tool-popover[data-theme="dark"] .ignore-btn:hover { color: #60a5fa; }
/* Layout horizontal (pills) */
.language-tool-popover.horizontal-layout {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
}
.language-tool-popover[data-theme="dark"].horizontal-layout {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}
.pill-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
}
.pill-btn:hover {
    background: #ffffff;
    border-color: rgba(59, 130, 246, 0.2);
    color: #2563eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
}
.pill-btn.primary {
    background: rgba(59, 130, 246, 0.08);
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.2);
}
.pill-btn.primary:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
}
.language-tool-popover[data-theme="dark"] .pill-btn { color: #cbd5e1; }
.language-tool-popover[data-theme="dark"] .pill-btn:hover {
    background: #334155;
    border-color: rgba(255, 255, 255, 0.1);
    color: #60a5fa;
}
.language-tool-popover[data-theme="dark"] .pill-btn.primary {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}
.divider {
    width: 1px;
    height: 16px;
    background: rgba(0, 0, 0, 0.08);
    margin: 0 2px;
    flex-shrink: 0;
}
/* Confirm de correção em lote */
.language-bulk-confirm {
    position: fixed;
    z-index: 100000;
    min-width: 190px;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(6px);
}
.dark .language-bulk-confirm {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow: 0 10px 20px rgba(2, 6, 23, 0.45);
}
.language-bulk-confirm-title {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #334155;
}
.dark .language-bulk-confirm-title { color: #cbd5e1; }
.language-bulk-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}
.language-bulk-confirm-btn {
    border: none;
    border-radius: 7px;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}
.language-bulk-confirm-btn.yes { background: #2563eb; color: #fff; }
.language-bulk-confirm-btn.yes:hover { background: #1d4ed8; }
.language-bulk-confirm-btn.no { background: #e2e8f0; color: #334155; }
.language-bulk-confirm-btn.no:hover { background: #cbd5e1; }

/* Mensagem destacada pela busca */
.highlighted-message {
    background-color: rgba(255, 193, 7, 0.3) !important;
    border-left: 4px solid #ffc107 !important;
    animation: highlightPulse 2s ease;
}
@keyframes highlightPulse {
    0% { background-color: rgba(255, 193, 7, 0.6); }
    100% { background-color: rgba(255, 193, 7, 0.3); }
}

/* Pin da mensagem fixada (no balão e no banner) */
.msg-pin {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 11px;
    color: #3b82f6;
    opacity: 0.85;
    z-index: 3;
}
.msg-pin i { transform: rotate(45deg); }

/* Botão "ir para última mensagem" (igual ao original MessagesList) */
.scroll-to-bottom-btn {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.scroll-to-bottom-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}
.scroll-to-bottom-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
.scroll-to-bottom-btn:active {
    transform: scale(0.95);
}

/* Botão estrelinha para salvar figurinha (aparece no hover, igual ao original) */
.sticker-fav-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fbbf24;
    color: #fff;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transform: scale(0.7);
    transition: all 0.2s ease;
    z-index: 5;
}
.group:hover .sticker-fav-btn {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}
.sticker-fav-btn:hover {
    background: #f59e0b;
    transform: scale(1.1);
}

/* Item do menu de opções do ticket (⋯) */
.ticket-options-item:hover .w-7 {
    background: currentColor !important;
    color: #fff !important;
}
.ticket-options-item span:first-child { transition: all 0.2s ease; }

/* Drawer do contato - animação de deslizar que empurra a conversa (igual original) */
#drawer-container {
    display: flex;
    height: 100%;
    position: relative;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}
#conversation-main {
    flex: 1;
    min-width: 0;
    transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-right: 0;
}
#conversation-main.shifted {
    margin-right: 320px;
}
.contact-drawer {
    flex-shrink: 0;
    width: 320px;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
}
.contact-drawer.open {
    transform: translateX(0);
}

/* Animação de entrada do modal de imagem */
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Kanban */
[data-kanban-cards].drag-over {
    background: rgba(59, 130, 246, 0.08);
    outline: 2px dashed rgba(59, 130, 246, 0.4);
    outline-offset: -2px;
}
.kanban-card[draggable="true"] {
    user-select: none;
    -webkit-user-select: none;
}
.kanban-card.opacity-50 { opacity: 0.5; }
.kanban-menu-item:hover .w-7 { background: currentColor !important; color: #fff !important; }
.kanban-menu-item span:first-child { transition: all 0.2s ease; }

.reactions-popover {
    position: fixed;
    z-index: 10000;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.dark .reactions-popover { background: #1e293b; border-color: #334155; }
.reactions-popover .reaction-btn {
    font-size: 22px;
    padding: 4px;
    cursor: pointer;
    border: none;
    background: transparent;
    border-radius: 50%;
    transition: transform 0.15s;
    line-height: 1;
}
.reactions-popover .reaction-btn:hover { transform: scale(1.3); }

/* Indicador digitando */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ffffff;
    padding: 10px 14px;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.dark .typing-indicator { background: #374151; }
.typing-indicator .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9ca3af;
    animation: typing-bounce 1.3s infinite;
}
.typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* Indicador gravando áudio */
.recording-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 8px 12px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    min-width: 36px;
    height: 32px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.dark .recording-indicator { background: #374151; }
.recording-mic-svg {
    width: 16px;
    height: 16px;
    color: #9ca3af;
    animation: recording-pulse 1.2s ease-in-out infinite;
}
.dark .recording-mic-svg { color: #b0b3b8; }
@keyframes recording-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* Prévia de mídia no input */
.media-preview-item { position: relative; }
.media-preview-item img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
}
.media-preview-item .remove-media {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 9999px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Toast */
.toast-msg {
    min-width: 220px;
    max-width: 360px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
    animation: toast-in 0.2s ease-out;
}
.toast-msg.error { background: #ef4444; }
.toast-msg.success { background: #22c55e; }
.toast-msg.info { background: #4287f5; }
.toast-msg.warning { background: #f59e0b; }
.toast-msg { max-width: 460px; line-height: 1.45; }
@keyframes toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Separador de data */
.date-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 12px 0;
}
.date-divider span {
    background: rgba(100, 116, 139, 0.12);
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 9999px;
}

/* Skeleton da lista */
.ticket-skeleton {
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    align-items: center;
}
.ticket-skeleton .sk-avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #e2e8f0;
}
.dark .ticket-skeleton .sk-avatar { background: #374151; }
.ticket-skeleton .sk-line {
    height: 10px;
    border-radius: 5px;
    background: #e2e8f0;
}
.dark .ticket-skeleton .sk-line { background: #374151; }

/* ═══════════════════════ Input (MessageInputWorking) ═══════════════════════ */
#message-input-footer,
#quick-messages-bar,
#input-shell {
    min-width: 0;
}
#input-shell > .flex-1,
#input-shell .flex-1.relative {
    min-width: 0;
}
#input-shell textarea,
#input-shell [contenteditable="true"] {
    min-width: 0;
    width: 100%;
}
/* Placeholder para o input contenteditable (renderiza emojis Apple) */
#message-input[contenteditable="true"]:empty::before {
    content: attr(data-placeholder);
    color: #94a3b8;
    pointer-events: none;
}
.dark #message-input[contenteditable="true"]:empty::before {
    color: #64748b;
}
/* Evita que os emojis Apple fiquem desalinhados dentro do input */
#message-input[contenteditable="true"] .epr-emoji {
    width: 1.5em;
    height: 1.5em;
    margin: 0 .05em 0 .1em;
    vertical-align: -0.1em;
    display: inline-block;
}
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

.attachment-menu-glass {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    animation: attachmentMenuIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.dark .attachment-menu-glass, .attachment-menu-glass.dark {
    background: rgba(31, 41, 55, 0.9);
    border: 1px solid rgba(75, 85, 99, 0.3);
}
@keyframes attachmentMenuIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.attachment-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 18px;
    transition: all 0.2s ease;
    flex: 1;
    text-align: left;
}
.attachment-menu-item:hover {
    background: rgba(0, 98, 255, 0.05);
    transform: translateX(4px);
}
.dark .attachment-menu-item:hover { background: rgba(59, 130, 246, 0.1); }
.attachment-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.attachment-menu-item:hover .attachment-icon-box { transform: scale(1.05); }
.attachment-menu-label { font-size: 12px; font-weight: 700; transition: all 0.2s ease; }

/* Segunda seção do menu de anexos (Pix e Catálogo) */
.attachment-menu-divider { height: 1px; background: rgba(148, 163, 184, 0.2); margin: 4px 10px; }
.attachment-menu-section { display: flex; flex-direction: column; }

.quick-messages-scroll-btn { transition: all 0.2s ease; }
.quick-messages-scroll-btn:hover {
    transform: scale(1.1);
    background: rgba(59, 130, 246, 0.08) !important;
}
.quick-message-button { transition: all 0.2s ease; position: relative; overflow: hidden; }
.quick-message-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}
.quick-message-button:active:not(:disabled) { transform: scale(0.98); }

/* Toggle "Assinar" */
.switch { position: relative; display: inline-block; width: 34px; height: 18px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: 0.4s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: 0.4s;
    border-radius: 50%;
}
input:checked + .slider { background-color: #2563eb; }
input:checked + .slider:before { transform: translateX(16px); }
.dark .slider { background-color: #475569; }

/* Barras do gravador de áudio */
.record-bar {
    width: 3px;
    border-radius: 2px;
    background-color: #2563eb;
    opacity: 0.9;
    transition: height 0.1s ease-out;
    min-height: 2px;
}
.record-bar:nth-child(odd) { opacity: 0.7; }

/* Item de etiqueta no modal */
.tag-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}
.tag-chip:hover { background: rgba(59, 130, 246, 0.06); }
.tag-chip.selected {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.4);
}

/* ─── Emojis (imagens Apple, iguais ao seletor emoji-picker-react) ─── */
img.epr-emoji {
  width: 1.5em;
  height: 1.5em;
  margin: 0 .05em 0 .1em;
  vertical-align: -0.1em;
  display: inline-block;
  max-width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

/* 🗑️ Mensagem apagada (revoke) */
.msg-bubble.msg-bubble-deleted {
  border-style: dashed;
  opacity: .9;
}
.msg-deleted-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-style: italic;
  font-size: .9em;
  color: #94a3b8;
  margin-bottom: 4px;
}
.dark .msg-deleted-note {
  color: #64748b;
}
.msg-deleted-body {
  font-size: .95em;
  opacity: .6;
}

/* 🎧 Mini-player de áudio — faixa no rodapé do painel de tickets (estilo WhatsApp Web) */
.mini-audio-strip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, .08);
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform .28s cubic-bezier(.22, 1, .36, 1), opacity .22s ease;
}
.dark .mini-audio-strip {
  background: #111827;
  border-top-color: #374151;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, .35);
}
.mini-audio-strip.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.mini-audio-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 14px;
}
.mini-btn-play {
  width: 34px; height: 34px; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: #2563eb; color: #fff;
  transition: background .2s ease;
}
.mini-btn-play:hover { background: #1d4ed8; }
.mini-audio-info { flex: 1; min-width: 0; }
.mini-audio-title {
  font-size: 11px; font-weight: 700; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: #334155;
}
.dark .mini-audio-title { color: #e5e7eb; }
.mini-audio-track {
  height: 4px; margin-top: 4px; border-radius: 9999px;
  background: #e2e8f0; overflow: hidden;
}
.dark .mini-audio-track { background: #374151; }
.mini-audio-fill {
  height: 100%; width: 0%;
  border-radius: 9999px; background: #3b82f6;
}
.mini-btn-rate {
  flex-shrink: 0;
  font-size: 11px; font-weight: 700;
  padding: 4px 9px; border-radius: 9999px;
  background: #f1f5f9; color: #475569;
  transition: background .2s ease;
}
.mini-btn-rate:hover { background: #e2e8f0; }
.dark .mini-btn-rate { background: #374151; color: #d1d5db; }
.dark .mini-btn-rate:hover { background: #4b5563; }
.mini-btn-close {
  flex-shrink: 0;
  color: #94a3b8;
  transition: color .2s ease;
}
.mini-btn-close:hover { color: #ef4444; }

/* Altura mais confortável do mini-player */
.mini-audio-inner {
  padding: 14px 18px;
  gap: 12px;
}
.mini-avatar-wrap {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dark .mini-avatar-wrap { background: #374151; }
.mini-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mini-avatar-wrap span {
  font-size: 15px;
  font-weight: 700;
  color: #64748b;
}
.dark .mini-avatar-wrap span { color: #9ca3af; }
.mini-btn-play {
  width: 38px;
  height: 38px;
}
.mini-audio-title {
  font-size: 12px;
}
.mini-audio-track {
  height: 5px;
  margin-top: 6px;
}
.mini-btn-rate {
  font-size: 12px;
  padding: 6px 11px;
}

/* 👤 Nome do participante em mensagens de grupo */
.msg-sender-name {
  font-size: 11px;
  font-weight: 600;
  opacity: .75;
  margin-bottom: 2px;
}

/* Chip de inicial junto ao nome do remetente em grupos */
.msg-sender-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-right: 5px;
  border-radius: 4px;
  background: #3b82f6;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  vertical-align: -2px;
}

/* 🖼️ Foto real do participante no label de grupo */
.msg-sender-avatar {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  object-fit: cover;
  margin-right: 5px;
  vertical-align: -3px;
  background: #e2e8f0;
}
.dark .msg-sender-avatar { background: #374151; }

/* ═══ 👥 Estilo WhatsApp Web para GRUPOS: avatar fora da bolha + rabinho ═══ */

/* Calha à esquerda reservada quando o ticket aberto é grupo */
#messages-list.chat-is-group .msg-row.from-other {
  margin-left: 46px;
}

/* Avatar QUADRADO (bordas arredondadas), alinhado ao TOPO da bolha —
   a pontinha reta do canto superior esquerdo do balão aponta pra ele */
.msg-row.from-other .msg-group-avatar {
  position: absolute;
  left: -44px;
  top: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  overflow: hidden;
  background: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
}
.dark .msg-row.from-other .msg-group-avatar { background: #4b5563; }
.msg-row.from-other .msg-group-avatar img.msg-group-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.msg-row.from-other .msg-group-avatar .msg-group-avatar-chip {
  font-size: 15px;
  font-weight: 700;
  color: #475569;
}
.dark .msg-row.from-other .msg-group-avatar .msg-group-avatar-chip { color: #d1d5db; }

/* Nome + número dentro da bolha (grupos) */
.msg-sender-name {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #2563eb;
  margin-bottom: 2px;
}
.dark .msg-sender-name { color: #93c5fd; }
.msg-sender-num {
  font-size: 10.5px;
  font-weight: 500;
  opacity: .65;
}

/* ═══════════════════════ Audio Player (WhatsApp style) ═══════════════════════ */
.audio-player {
  min-width: 260px;
  max-width: 400px;
  width: 100%;
}
.audio-player-main {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
/* Play button — azul WhatsApp */
.audio-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #0084ff;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
  box-shadow: 0 2px 4px rgba(0,132,255,0.3);
}
.audio-play-btn:hover { transform: scale(1.08); background: #0073e6; }
.audio-play-btn svg { margin-left: 2px; }

/* Container da onda/tempo */
.audio-wave-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
/* Barra de onda — só as barras, sem fundo */
.audio-wave {
  width: 100%;
  height: 28px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Barras de onda — largura FIXA e uniforme (como WhatsApp), só a altura varia */
.audio-wave-bars {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  padding: 0 1px;
  position: relative;
  z-index: 1;
}
.wave-bar {
  flex: 0 0 auto;
  width: 3px;
  border-radius: 2px;
  background: #b0bec5;
  transition: background 0.15s;
}
.dark .wave-bar { background: rgba(255,255,255,0.3); }

/* Avatar dentro do player — quadrado com bordas arredondadas */
.audio-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  border: 1px solid #d0d7de;
}

/* Slot do avatar (para toggle com speed button) */
.audio-avatar-slot {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

/* Botão de velocidade (substitui avatar quando tocando) */
.audio-speed-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #d0d7de;
  background: #f0f2f5;
  color: #3b3b3b;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  user-select: none;
}
.audio-speed-btn:hover {
  background: #e4e6e9;
}
.dark .audio-speed-btn {
  background: #3b3b3b;
  color: #e4e6e9;
  border-color: #555;
}
.dark .audio-speed-btn:hover {
  background: #4a4a4a;
}
.dark .audio-avatar { border-color: #4b5563; }
.audio-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Footer bar — tempo (esq) | transcrever (centro) | hora msg (dir) */
.audio-footer-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-top: 1px solid rgba(0,0,0,0.05);
  padding-top: 6px;
  margin-top: 8px;
}
.dark .audio-footer-bar { border-top-color: rgba(255,255,255,0.08); }
.audio-footer-bar .audio-time-display { justify-self: start; }
.audio-footer-bar .audio-transcribe-btn { justify-self: center; }
.audio-footer-bar .audio-msg-time { justify-self: end; }
.audio-time-display {
  font-size: 11px;
  font-weight: 500;
  color: #65676b;
}
.dark .audio-time-display { color: rgba(255,255,255,0.5); }
.audio-msg-time {
  font-size: 11px;
  font-weight: 500;
  color: #65676b;
}
.dark .audio-msg-time { color: rgba(255,255,255,0.5); }
.audio-transcribe-btn {
  background: #f0f2f5;
  color: #0084ff;
  border: 1px solid #d0d7de;
  border-radius: 12px;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: background 0.2s;
}
.audio-transcribe-btn:hover { background: #e4e6eb; }
.dark .audio-transcribe-btn { background: #374151; color: #60a5fa; border-color: #4b5563; }
.dark .audio-transcribe-btn:hover { background: #4b5563; }

/* ═══════════════════════ Avatar do áudio (fora da bolha) ═══════════════════════ */
.msg-audio-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.msg-audio-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
