@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-main: #0B0F19;
    --bg-surface: #111827;
    --bg-card: #1F2937;
    --bg-card-hover: #263346;
    --border-subtle: #374151;
    --border-focus: #6366F1;
    
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    
    --primary: #6366F1;
    --primary-hover: #4F46E5;
    --primary-gradient: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    
    --whatsapp-color: #25D366;
    --telegram-color: #229ED9;
    --instagram-gradient: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    
    --bubble-me: #3730A3;
    --bubble-contact: #1E293B;
    
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    
    --sidebar-width: 72px;
    --chat-list-width: 340px;
    --lead-panel-width: 320px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    display: flex;
}

/* ==========================================================================
   SIDEBAR PRINCIPAL
   ========================================================================== */
.main-sidebar {
    width: var(--sidebar-width);
    background-color: #080C14;
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    z-index: 100;
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
    cursor: pointer;
}

.brand-icon svg {
    width: 24px;
    height: 24px;
    fill: #ffffff;
}

.nav-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    align-items: center;
    flex: 1;
}

.nav-btn {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-card);
}

.nav-btn.active {
    color: #ffffff;
    background: var(--primary-gradient);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.badge-counter {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid #080C14;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.avatar-user {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    cursor: pointer;
}

/* ==========================================================================
   CONTAINER DE CONTEÚDO
   ========================================================================== */
.app-container {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

.view-section {
    display: none;
    width: 100%;
    height: 100%;
}

.view-section.active {
    display: flex;
}

/* ==========================================================================
   TELA DO CHAT (INBOX OMNICANAL)
   ========================================================================== */
.chat-list-panel {
    width: var(--chat-list-width);
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
}

.chat-list-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.chat-list-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-box {
    position: relative;
    width: 100%;
    margin-bottom: 12px;
}

.search-box input {
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 8px 12px 8px 36px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: border 0.2s;
}

.search-box input:focus {
    border-color: var(--border-focus);
}

.search-box svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    fill: var(--text-muted);
}

.channel-filter-pills {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.channel-filter-pills::-webkit-scrollbar {
    display: none;
}

.pill-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.pill-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.pill-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.conversations-scroll {
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background-color 0.15s;
    position: relative;
}

.conversation-item:hover {
    background-color: var(--bg-card);
}

.conversation-item.active {
    background-color: #1e1b4b;
    border-left: 3px solid var(--primary);
}

.conv-avatar-wrap {
    position: relative;
    margin-right: 12px;
}

.conv-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #374151;
}

.channel-badge-icon {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-surface);
}

.channel-badge-icon.whatsapp_web { display: none; }
.channel-badge-icon.telegram { background: var(--telegram-color); }
.channel-badge-icon.instagram { background: var(--instagram-gradient); }

.conv-details {
    flex: 1;
    min-width: 0;
}

.conv-top-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.conv-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-time {
    font-size: 11px;
    color: var(--text-muted);
}

.conv-bottom-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conv-preview {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.conv-unread {
    background: var(--primary);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 6px;
}

/* ==========================================================================
   ÁREA CENTRAL DO CHAT
   ========================================================================== */
.chat-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-main);
    border-right: 1px solid var(--border-subtle);
}

.chat-header {
    height: 64px;
    padding: 0 20px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-name {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 700;
}

.chat-header-status {
    font-size: 12px;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--success);
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-header {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-header:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
}

.message-bubble {
    max-width: 65%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    position: relative;
    word-break: break-word;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-bubble.contact {
    align-self: flex-start;
    background-color: #202c33;
    color: #e9edef;
    border-radius: 12px 12px 12px 2px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.message-bubble.me {
    align-self: flex-end;
    background: #005c4b;
    color: #e9edef;
    border-radius: 12px 12px 2px 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.message-bubble a {
    color: #53bdeb;
    text-decoration: underline;
    word-break: break-all;
    cursor: pointer;
    font-weight: 500;
}

.message-bubble a:hover {
    color: #7dd3fc;
    text-decoration: underline;
}

.message-bubble.me a {
    color: #a7f3d0;
}

.message-bubble.me a:hover {
    color: #d1fae5;
}

.message-time {
    font-size: 10px;
    opacity: 0.65;
    margin-top: 4px;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
}

.msg-status-check {
    color: #53bdeb;
    font-size: 11px;
    font-weight: 700;
}

/* Player de áudio estilo WhatsApp Web */
.audio-player-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
    padding: 6px 0;
}

.audio-play-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.audio-play-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.audio-waveform-bars {
    display: flex;
    align-items: center;
    gap: 3px;
    flex: 1;
    height: 28px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    user-select: none;
    position: relative;
    transition: background 0.2s;
}

.audio-waveform-bars:hover {
    background: rgba(255, 255, 255, 0.08);
}

.waveform-bar {
    width: 3px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 3px;
    transition: background 0.15s, height 0.15s;
    pointer-events: none;
}

.waveform-bar.played {
    background: #25D366 !important;
}

.message-bubble.me .waveform-bar.played {
    background: #34D399 !important;
}

.audio-player-custom.playing .waveform-bar.active-bounce {
    animation: waveBounce 0.5s infinite alternate;
}

@keyframes waveBounce {
    0% { transform: scaleY(0.7); }
    100% { transform: scaleY(1.3); }
}

/* Lightbox de Foto Ampliada */
.photo-lightbox-card {
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    overflow: hidden;
    max-width: 820px;
    width: 92%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85);
    animation: zoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomIn {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.photo-lightbox-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #1F2937;
}

.photo-lightbox-image-box {
    background: #0B0E14;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    flex: 1;
    overflow: hidden;
    min-height: 320px;
}

.photo-lightbox-image-box img {
    width: 480px;
    height: 480px;
    max-width: min(85vw, 480px);
    max-height: min(68vh, 480px);
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 12px 30px rgba(0,0,0,0.7);
    background: #111827;
}

/* Card de Contato vCard Compartilhado (Estilo WhatsApp) */
.contact-card-bubble {
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px;
    min-width: 250px;
    max-width: 320px;
}
.contact-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.contact-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: #1F2937;
    flex-shrink: 0;
}
.contact-card-name {
    font-weight: 700;
    font-size: 14px;
    color: #FFFFFF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.contact-card-phone {
    font-size: 12px;
    color: #6EE7B7;
    margin-top: 2px;
    font-weight: 600;
}
.contact-card-badge {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}
.contact-card-actions {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 8px;
    display: flex;
    gap: 8px;
}
.contact-card-btn-chat {
    flex: 1;
    text-align: center;
    padding: 7px 12px;
    background: #25D366;
    color: #0B0E14;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s;
}
.contact-card-btn-chat:hover {
    background: #1EBE5D;
}
.contact-card-btn-copy {
    padding: 7px 12px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}
.contact-card-btn-copy:hover {
    background: rgba(255, 255, 255, 0.16);
}

.photo-lightbox-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: #1F2937;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Video Player Modal WhatsApp */
.video-player-card {
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    overflow: hidden;
    max-width: 840px;
    width: 92%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
    animation: zoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.video-player-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #1F2937;
}

.video-player-box {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    flex: 1;
    overflow: hidden;
    min-height: 320px;
}

.video-player-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: #1F2937;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Grupos em Comum na Sidebar */
.lead-common-group-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.lead-common-group-item:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(2px);
}

.lead-common-group-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #1F2937;
}

.lead-common-group-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.lead-media-gallery img {
    width: 100%;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s;
}

.lead-media-gallery img:hover {
    transform: scale(1.04);
}

/* Barra de Digitação */
.chat-input-bar {
    padding: 12px 20px;
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.input-action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.input-action-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.input-action-btn.recording {
    background: var(--danger);
    color: white;
    animation: pulse 1.2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.chat-input-wrapper {
    flex: 1;
    position: relative;
}

.chat-text-input {
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border 0.2s;
}

.chat-text-input:focus {
    border-color: var(--border-focus);
}

.btn-send {
    background: var(--primary-gradient);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s;
}

.btn-send:hover {
    transform: scale(1.05);
}

/* Popover de Respostas Rápidas */
.quick-replies-popover {
    position: absolute;
    bottom: 68px;
    left: 20px;
    width: 320px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 50;
}

.quick-replies-popover.active {
    display: flex;
}

.qr-popover-header {
    padding: 8px 12px;
    background: var(--bg-card);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.qr-item {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.qr-item:hover {
    background-color: var(--bg-card-hover);
}

.qr-shortcut {
    font-weight: 700;
    color: var(--primary);
    font-size: 13px;
}

.qr-title {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ==========================================================================
   PAINEL LATERAL DO LEAD (ESTILO WATIDY / PANCAKE)
   ========================================================================== */
.lead-panel {
    width: var(--lead-panel-width);
    background-color: var(--bg-surface);
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

.lead-header-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 20px;
}

.lead-avatar-lg {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin-bottom: 12px;
    border: 3px solid var(--primary);
}

.lead-name-lg {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
}

.lead-phone-lg {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.lead-section {
    margin-bottom: 20px;
}

.lead-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.lead-value-box {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 8px 12px;
}

.lead-value-box span {
    color: var(--success);
    font-weight: 700;
    margin-right: 6px;
}

.lead-value-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 700;
    width: 100%;
    outline: none;
}

.stage-select {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-badge {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
}

/* ==========================================================================
   TELA DO CRM KANBAN (FUNIL DE VENDAS)
   ========================================================================== */
.kanban-view-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow-x: auto;
}

.kanban-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.kanban-top-bar h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 800;
}

.kanban-board {
    display: flex;
    gap: 16px;
    flex: 1;
    overflow-x: auto;
    padding-bottom: 12px;
}

.kanban-column {
    min-width: 280px;
    width: 280px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.kanban-column-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.column-title-pill {
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.column-pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.column-total-val {
    font-size: 12px;
    font-weight: 700;
    color: var(--success);
}

.kanban-cards-area {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 12px;
    cursor: grab;
    transition: all 0.2s;
    user-select: none;
}

.kanban-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.kanban-card.dragging {
    opacity: 0.5;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.card-contact-name {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
}

.card-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--success);
}

.card-priority {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
}

.card-priority.urgent { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.card-priority.high { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.card-priority.medium { background: rgba(99, 102, 241, 0.2); color: var(--primary); }

/* ==========================================================================
   TELA DE CANAIS CONECTADOS
   ========================================================================== */
.channels-view-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 20px;
    overflow-y: auto;
}

.channels-view-container h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 8px;
}

.channel-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.channel-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.channel-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.channel-card-icon.whatsapp { background: var(--whatsapp-color); }
.channel-card-icon.telegram { background: var(--telegram-color); }
.channel-card-icon.instagram { background: var(--instagram-gradient); }

.channel-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.channel-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.channel-status-pill.connected {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.channel-status-pill.disconnected {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.channel-config-form {
    width: 100%;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.channel-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
}

/* ==========================================================================
   CANAL FACEBOOK MESSENGER
   ========================================================================== */
.channel-badge-icon.facebook { background: #1877F2; }
.channel-card-icon.facebook { background: #1877F2; }

/* ==========================================================================
   MENSAGENS DO SISTEMA & FORMATAÇÃO DE ASSINATURA
   ========================================================================== */
.message-bubble.system {
    align-self: center;
    background: rgba(99, 102, 241, 0.12);
    border: 1px dashed rgba(99, 102, 241, 0.4);
    color: #C7D2FE;
    font-size: 12px;
    font-style: italic;
    border-radius: 20px;
    padding: 6px 16px;
    margin: 6px 0;
    max-width: 85%;
    text-align: center;
}

.message-bubble strong {
    color: #FBBF24;
    font-weight: 700;
    display: block;
    margin-bottom: 2px;
}

.signature-pill-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.signature-pill-toggle.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    color: var(--text-primary);
}

/* ==========================================================================
   MODAIS (TRANSFERÊNCIA & GESTÃO DE EQUIPE)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.15s ease-out;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
}

.modal-user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
}

.modal-user-item:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

/* ==========================================================================
   FILTROS DE ATRIBUIÇÃO NO INBOX (TODAS / MINHAS / FILA GERAL)
   ========================================================================== */
.assignment-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    padding: 3px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.assignment-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 5px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.assignment-tab-btn.active {
    background: var(--primary);
    color: white;
}

.btn-back-mobile {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    margin-right: 8px;
    cursor: pointer;
}

/* ==========================================================================
   RESPONSIVIDADE MOBILE (SMARTPHONES E TABLETS)
   ========================================================================== */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 60px;
        --chat-list-width: 100%;
        --lead-panel-width: 100%;
    }

    body {
        flex-direction: column-reverse;
    }

    /* Sidebar vira barra de navegação inferior */
    .main-sidebar {
        width: 100%;
        height: 60px;
        flex-direction: row;
        justify-content: space-around;
        padding: 0 10px;
        border-right: none;
        border-top: 1px solid var(--border-subtle);
    }

    .brand-icon {
        display: none;
    }

    .nav-items {
        flex-direction: row;
        justify-content: space-around;
        width: 100%;
    }

    .sidebar-footer {
        display: none;
    }

    .app-container {
        height: calc(100vh - 60px);
    }

    /* Na tela de chat, alterna entre Lista e Conversa */
    .chat-list-panel {
        width: 100%;
    }

    .chat-main-area {
        display: none;
        width: 100%;
    }

    /* Quando uma conversa estiver aberta no mobile */
    .view-inbox.chat-open .chat-list-panel {
        display: none;
    }

    .view-inbox.chat-open .chat-main-area {
        display: flex;
    }

    .btn-back-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Painel do Lead no celular */
    .lead-panel {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 60px;
        z-index: 200;
    }

    .lead-panel.mobile-active {
        display: flex;
    }

    .kanban-view-container {
        padding: 12px;
    }

    .kanban-column {
        min-width: 250px;
    }
}

/* ==========================================================================
   SINCRONIZAÇÃO WHATSAPP & AVATAR EDIT
   ========================================================================== */
.btn-sync-header {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(37, 211, 102, 0.15);
    border: 1px solid rgba(37, 211, 102, 0.35);
    color: #25D366;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sync-header:hover {
    background: #25D366;
    color: white;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.btn-avatar-edit-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 26px;
    height: 26px;
    background: var(--primary);
    border: 2px solid var(--bg-surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s;
}

.btn-avatar-edit-badge:hover {
    transform: scale(1.1);
}

.btn-sm-action {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-sm-action:hover {
    background: var(--primary-hover);
}

/* ABAS DE TIPO DE CONVERSA (TODAS / INDIVIDUAIS / GRUPOS) */
.chat-type-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    padding: 3px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

.chat-type-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.chat-type-btn:hover {
    color: var(--text-primary);
}

.chat-type-btn.active {
    background: var(--bg-surface);
    color: var(--primary-light);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* TAGS & BADGES COLORIDOS */
.tag-badge-sm {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    line-height: 1.3;
}

.tag-badge-removable {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.tag-remove-btn {
    background: transparent;
    border: none;
    color: inherit;
    font-weight: 800;
    font-size: 11px;
    cursor: pointer;
    padding: 0 2px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.tag-remove-btn:hover {
    opacity: 1;
}

.group-indicator-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(139, 92, 246, 0.15);
    color: #C4B5FD;
    border: 1px solid rgba(139, 92, 246, 0.3);
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
}

.backup-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    transition: background 0.15s;
}

.backup-item-row:hover {
    background: var(--bg-card-hover, #1F2937);
}

.tag-manager-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
}

/* ==========================================================================
   PAINEL DO LEAD COLAPSÁVEL & CONTROLES
   ========================================================================== */
.lead-panel.collapsed {
    display: none !important;
}

/* ==========================================================================
   MENU FLUTUANTE DE ANEXOS ESTILO WHATSAPP WEB (10 ITENS EXATOS)
   ========================================================================== */
.whatsapp-attach-menu {
    position: absolute;
    bottom: 74px;
    left: 20px;
    width: 230px;
    background: #111b21;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 8px 0;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
    display: none;
    flex-direction: column;
    z-index: 1000;
    animation: attachPopupAnim 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
}

.whatsapp-attach-menu.active {
    display: flex;
}

@keyframes attachPopupAnim {
    from { opacity: 0; transform: translateY(12px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.attach-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 9px 18px;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}

.attach-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.attach-icon-circle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.attach-item-label {
    font-size: 14px;
    color: #E2E8F0;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.attach-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 6px 14px;
}

.icon-doc { color: #8B5CF6; }
.icon-media { color: #3B82F6; }
.icon-camera { color: #EC4899; }
.icon-audio { color: #F97316; }
.icon-contact { color: #06B6D4; }
.icon-poll { color: #FBBF24; }
.icon-event { color: #F43F5E; }
.icon-sticker { color: #10B981; }
.icon-location { color: #00A884; }
.icon-catalog { color: #94A3B8; }
.icon-quick { color: #EAB308; }

/* ==========================================================================
   BARRA DE GRAVAÇÃO DE ÁUDIO COM CONTROLE DE TEMPO EM SEGUNDOS
   ========================================================================== */
.audio-recording-bar {
    display: none;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 24px;
    padding: 6px 16px;
    margin: 0 8px;
    animation: fadeIn 0.2s ease-in-out;
}

.recording-pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #EF4444;
    display: inline-block;
    animation: pulseRed 1s infinite alternate;
}

@keyframes pulseRed {
    0% { transform: scale(0.8); opacity: 0.5; box-shadow: 0 0 0 rgba(239, 68, 68, 0.7); }
    100% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 10px rgba(239, 68, 68, 0.9); }
}

/* ==========================================================================
   MENU DE CONTEXTO CUSTOMIZADO (BOTÃO DIREITO / CLIQUE NOS CLIENTES)
   ========================================================================== */
.custom-context-menu {
    position: fixed;
    z-index: 10000;
    background: #1F2937;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 6px 0;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6);
    width: 220px;
    display: none;
    backdrop-filter: blur(8px);
}

.custom-context-menu.active {
    display: flex;
    flex-direction: column;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 13px;
    color: #E5E7EB;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.context-menu-item.danger {
    color: #F87171;
}

.context-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.context-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 0;
}

.conv-options-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
}

.conversation-item:hover .conv-options-btn {
    opacity: 1;
}

.conv-options-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* ==========================================================================
   CARDS DE MENSAGENS RICOS (DOCUMENTO, FIGURINHA, ENQUETE, EVENTO, CATÁLOGO)
   ========================================================================== */
.doc-bubble-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.25);
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 6px;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.15s;
}

.doc-bubble-card:hover {
    background: rgba(0, 0, 0, 0.35);
}

.sticker-bubble-img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}

.poll-bubble-card {
    min-width: 250px;
    padding: 4px 0;
}

.poll-option-row {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.15s;
}

.poll-option-row:hover {
    background: rgba(255, 255, 255, 0.12);
}

.event-bubble-card {
    min-width: 240px;
    padding: 10px 12px;
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.3);
    border-radius: 10px;
}

.contact-bubble-card {
    min-width: 230px;
    padding: 10px 12px;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.catalog-bubble-card {
    min-width: 240px;
    max-width: 280px;
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   FIGURINHAS ESTILO WHATSAPP WEB (TRANSPARENTE, SEM FUNDO DE BALÃO)
   ========================================================================== */
.message-bubble.sticker-bubble-wrap {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 4px 0 !important;
    max-width: 160px !important;
    position: relative;
    display: inline-flex;
    flex-direction: column;
}

.sticker-bubble-img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    display: block;
    cursor: pointer;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.45));
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sticker-bubble-img:hover {
    transform: scale(1.08);
}

.sticker-bubble-wrap .message-time {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    pointer-events: none;
}

.sticker-loading-placeholder {
    width: 140px;
    height: 140px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    gap: 6px;
    transition: all 0.2s;
}

.sticker-loading-placeholder:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.35);
}

/* ==========================================================================
   CARD DE LOCALIZAÇÃO ESTILO WHATSAPP WEB
   ========================================================================== */
.location-bubble-card {
    min-width: 250px;
    max-width: 320px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.location-map-preview {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1.5px, transparent 1.5px);
    background-size: 16px 16px;
    transition: filter 0.2s;
}

.location-map-preview:hover {
    filter: brightness(1.15);
}

.location-pin-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid #EF4444;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.45);
    animation: pinBounce 1.5s infinite alternate;
}

@keyframes pinBounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-4px); }
}

.location-map-label {
    font-size: 11px;
    color: #94A3B8;
    margin-top: 6px;
    font-weight: 500;
}

.location-info {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.location-place-name {
    font-weight: 700;
    font-size: 13px;
    color: #F9FAFB;
}

.location-address {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.35;
}

.location-open-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 6px 14px;
    background: #10B981;
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    transition: background 0.15s;
    width: fit-content;
}

.location-open-link:hover {
    background: #059669;
}




/* ==========================================================================
   WHATSAPP WEB HOVER ACTIONS, REAÇÕES & MENU CONTEXTUAL
   ========================================================================== */
.message-bubble-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.message-bubble-row.contact {
    justify-content: flex-start;
}

.message-bubble-row.me {
    justify-content: flex-end;
}

.msg-hover-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease-in-out, transform 0.15s ease-in-out;
}

.message-bubble-row:hover .msg-hover-actions {
    opacity: 1;
    pointer-events: auto;
}

.msg-hover-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94A3B8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
    transition: all 0.15s ease;
    padding: 0;
}

.msg-hover-btn:hover {
    background: #2563EB;
    color: #FFFFFF;
    transform: scale(1.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.msg-hover-btn.react-btn:hover {
    background: #F59E0B;
}

.msg-bubble-chevron-btn {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94A3B8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
    z-index: 5;
    padding: 0;
}

.message-bubble:hover .msg-bubble-chevron-btn,
.sticker-bubble-wrap:hover .msg-bubble-chevron-btn {
    opacity: 1;
    pointer-events: auto;
}

.msg-bubble-chevron-btn:hover {
    background: #1E293B;
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.3);
}

/* CONTAINER DE REAÇÕES (PILL BADGE) */
.msg-reactions-container {
    position: absolute;
    bottom: -11px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.message-bubble.contact .msg-reactions-container {
    right: 8px;
}

.message-bubble.me .msg-reactions-container {
    right: 8px;
}

.sticker-bubble-wrap .msg-reactions-container {
    bottom: -10px;
    right: 6px;
    z-index: 12;
}

.msg-reaction-pill {
    background: #202c33;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 3px 7px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.55);
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.15s;
    user-select: none;
    line-height: 1.1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Emoji", "Noto Color Emoji", "Apple Color Emoji", sans-serif;
}

.msg-reaction-pill:hover {
    transform: scale(1.15);
    background: #2a3942;
}

.msg-reaction-pill.by-me {
    background: #025144;
    border-color: #00a884;
}

.msg-reaction-pill .reaction-emoji {
    font-size: 14px;
    display: inline-block;
    line-height: 1;
}

.msg-reaction-pill .reaction-count {
    font-size: 11px;
    font-weight: 700;
    color: #e9edef;
}

/* POPOVER DE SELEÇÃO DE REAÇÕES (EMOJIS RÁPIDOS) */
.reaction-picker-popover {
    position: fixed;
    z-index: 9999;
    background: #202C33;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: popInScale 0.16s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popInScale {
    from { opacity: 0; transform: scale(0.7) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.reaction-emoji-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: transparent;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.15s;
    padding: 0;
}

.reaction-emoji-btn:hover {
    transform: scale(1.35) translateY(-2px);
    background: rgba(255, 255, 255, 0.12);
}

.reaction-emoji-btn.active {
    background: rgba(16, 185, 129, 0.25);
    box-shadow: 0 0 0 1px #10B981;
}

.reaction-more-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: #94A3B8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.15s;
}

.reaction-more-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #FFFFFF;
}

/* MENU CONTEXTUAL ESTILO WHATSAPP WEB */
.message-context-menu {
    position: fixed;
    z-index: 10000;
    background: #233138;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
    padding: 6px 0;
    min-width: 210px;
    max-width: 270px;
    animation: menuFadeIn 0.15s ease-out;
}

@keyframes menuFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.ctx-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 500;
    color: #E9EDEF;
    cursor: pointer;
    transition: background 0.12s;
}

.ctx-menu-item:hover {
    background: #182229;
}

.ctx-menu-item.danger {
    color: #F87171;
}

.ctx-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.15);
}

.ctx-menu-item i {
    font-size: 14px;
    width: 16px;
    text-align: center;
    color: #8696A0;
}

.ctx-menu-item.danger i {
    color: #F87171;
}

.ctx-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 0;
}

/* BARRA DE MENSAGEM CITADA (QUOTE PREVIEW) */
#chat-quoted-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: #1E293B;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid #10B981;
    animation: slideDown 0.15s ease-out;
}

.quoted-bar-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.quoted-bar-sender {
    font-size: 11px;
    font-weight: 700;
    color: #10B981;
}

.quoted-bar-text {
    font-size: 12px;
    color: #94A3B8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quoted-bar-close {
    background: none;
    border: none;
    color: #94A3B8;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quoted-bar-close:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.1);
}

/* QUOTE INLINE DENTRO DO BALÃO */
.msg-inline-quote {
    background: rgba(0, 0, 0, 0.25);
    border-left: 3px solid #10B981;
    border-radius: 6px;
    padding: 5px 8px;
    margin-bottom: 6px;
    cursor: pointer;
    font-size: 11px;
}

.msg-inline-quote-sender {
    font-weight: 700;
    color: #10B981;
    margin-bottom: 2px;
}

.msg-inline-quote-text {
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

/* ÍCONE DE ESTRELA (MENSAGEM FAVORITA) */
.msg-star-badge {
    color: #FBBF24;
    font-size: 11px;
    margin-left: 4px;
}

/* ==========================================================================
   PAINEL EXPANDIDO DE EMOJIS DE REAÃÃO (ESTILO WHATSAPP WEB)
   ========================================================================== */
.extended-emoji-picker-popover {
    position: fixed;
    z-index: 10001;
    background: #202c33;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75);
    width: 360px;
    max-width: calc(100vw - 24px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: popInScale 0.16s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.emoji-picker-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px 0 12px;
    background: #202c33;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    user-select: none;
}

.emoji-tab-btn {
    background: transparent;
    border: none;
    color: #8696a0;
    cursor: pointer;
    padding: 4px 6px 8px 6px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 17px;
    line-height: 1;
    transition: color 0.15s, transform 0.15s;
}

.emoji-tab-btn:hover {
    color: #e9edef;
    transform: translateY(-1px);
}

.emoji-tab-btn.active {
    color: #e9edef;
}

.emoji-tab-indicator {
    position: absolute;
    bottom: 0;
    left: 4px;
    right: 4px;
    height: 2.5px;
    background: transparent;
    border-radius: 3px;
    transition: background 0.15s;
}

.emoji-tab-btn.active .emoji-tab-indicator {
    background: #ffffff;
}

.emoji-picker-search-bar {
    padding: 10px 14px 6px 14px;
    background: #202c33;
}

.emoji-picker-search-wrap {
    display: flex;
    align-items: center;
    background: #111b21;
    border-radius: 20px;
    padding: 7px 12px;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: border-color 0.15s;
}

.emoji-picker-search-wrap:focus-within {
    border-color: rgba(255, 255, 255, 0.2);
}

.emoji-search-icon {
    color: #8696a0;
    flex-shrink: 0;
}

#emoji-picker-search-input {
    background: transparent;
    border: none;
    color: #e9edef;
    font-size: 13px;
    flex: 1;
    outline: none;
    padding: 0;
}

#emoji-picker-search-input::placeholder {
    color: #8696a0;
}

.emoji-search-clear-btn {
    background: transparent;
    border: none;
    color: #8696a0;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 50%;
    line-height: 1;
}

.emoji-search-clear-btn:hover {
    color: #ffffff;
}

.emoji-picker-scroll-body {
    padding: 4px 14px 14px 14px;
    overflow-y: auto;
    max-height: 280px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.emoji-picker-scroll-body::-webkit-scrollbar {
    width: 6px;
}

.emoji-picker-scroll-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.emoji-category-title {
    font-size: 13px;
    font-weight: 600;
    color: #8696a0;
    margin: 14px 0 8px 4px;
    user-select: none;
}

.emoji-category-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.emoji-grid-item {
    height: 40px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.12s;
    user-select: none;
    background: transparent;
    border: none;
    padding: 0;
}

.emoji-grid-item:hover {
    transform: scale(1.25);
    background: rgba(255, 255, 255, 0.1);
}


/* SUPORTE UNIVERSAL A EMOJIS MODERNOS (NOTO COLOR EMOJI) */
.msg-reaction-pill, .reaction-emoji, .emoji-grid-item, .reaction-emoji-btn, .msg-reaction-pill span {
    font-family: "Noto Color Emoji", "Segoe UI Emoji", "Apple Color Emoji", sans-serif !important;
}


/* ==============================================================================
   SEPARADORES DE DATA E CARDS DE DOCUMENTO ESTILO WHATSAPP WEB
   ============================================================================== */
.chat-date-separator {
    text-align: center;
    margin: 18px 0 14px 0;
    display: flex;
    justify-content: center;
    user-select: none;
    position: relative;
    z-index: 2;
}

.chat-date-separator span {
    background: #182229;
    color: #8696a0;
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    letter-spacing: 0.3px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.chat-system-message-row {
    display: flex;
    justify-content: center;
    margin: 10px 0;
    width: 100%;
}

.message-bubble.system {
    background: #182229 !important;
    color: #ffd279 !important;
    font-size: 11.5px !important;
    font-weight: 500 !important;
    padding: 6px 16px !important;
    border-radius: 8px !important;
    max-width: 82% !important;
    text-align: center !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.45) !important;
    border: 1px solid rgba(255, 210, 121, 0.15) !important;
    line-height: 1.4 !important;
}

.doc-bubble-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 8px;
    padding: 10px 12px;
    margin: 2px 0 4px 0;
    min-width: 250px;
    max-width: 320px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.doc-bubble-card:hover {
    background: rgba(0, 0, 0, 0.35);
}

.doc-icon-box {
    width: 42px;
    height: 48px;
    background: #2a3942;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.doc-ext-badge {
    font-size: 11px;
    font-weight: 800;
    color: #e9edef;
    letter-spacing: 0.5px;
}

.doc-info {
    flex: 1;
    min-width: 0;
}

.doc-filename {
    font-size: 13.5px;
    font-weight: 600;
    color: #e9edef;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-meta-line {
    font-size: 11px;
    color: #8696a0;
    margin-top: 3px;
}

.doc-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #8696a0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.doc-bubble-card:hover .doc-action-btn {
    background: rgba(0, 168, 132, 0.25);
    color: #00a884;
    transform: scale(1.08);
}

.call-log-bubble {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #e9edef;
    padding: 2px 0;
}
