/* Estilos generales */
@import url('https://fonts.googleapis.com/css?family=Roboto:300,400,400i,500');
@import url('https://fonts.googleapis.com/css?family=Noto+Sans');

body {
    font-family: 'Roboto', sans-serif;
    overflow-x: hidden;
    background-color: #f8f9fa;
}

/* Estilos para el sidebar */
.sidebar {
    height: 100%;
    width: 250px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    background-color: #343a40;
    overflow-x: hidden;
    transition: transform 0.3s ease-in-out;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.sidebar header {
    background-color: #2c3136;
    padding: 20px 0;
    text-align: center;
    border-bottom: 1px solid #454d55;
}

.sidebar nav {
    padding-top: 20px;
}

.sidebar a {
    padding: 12px 20px;
    text-decoration: none;
    font-size: 16px;
    color: #adb5bd;
    display: block;
    transition: 0.3s;
    border-left: 4px solid transparent;
}

.sidebar a:hover {
    background-color: #454d55;
    color: #fff;
    border-left-color: #007bff;
}

.sidebar a.active {
    background-color: #454d55;
    color: #fff;
    border-left-color: #007bff;
}

.sidebar a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Contenido principal */
.main-content {
    margin-left: 250px;
    padding: 20px;
    transition: all 0.3s;
}

/* Toggle button para el sidebar */
.openbtn {
    font-size: 20px;
    cursor: pointer;
    background-color: transparent;
    color: #495057;
    padding: 10px 15px;
    border: none;
    margin-bottom: 20px;
}

.openbtn:hover {
    color: #007bff;
}

/* Estilos para el sidebar colapsado */
.sidebar-collapsed {
    width: 60px;
}

.sidebar-collapsed header img {
    width: 30px;
}

.sidebar-collapsed a span {
    display: none;
}

.sidebar-collapsed a i {
    margin-right: 0;
}

.main-content-expanded {
    margin-left: 60px;
}

/* Estilos para la landing page */
.landing-page header {
    min-height: 80px;
    display: flex;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.landing-page header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.landing-page header .logo {
    color: #333;
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
}

.landing-page header .links {
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.landing-page header .links li a {
    color: #555;
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
}

.landing-page header .links li:last-child a {
    background-color: #007bff;
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
}

.landing-page header .links li a:hover {
    color: #007bff;
}

.landing-page header .links li:last-child a:hover {
    background-color: #0069d9;
    color: #fff;
}

.landing-page .content {
    padding: 80px 0;
}

.landing-page .content .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
}

.landing-page .content .info {
    flex: 1;
}

.landing-page .content .info h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: #333;
}

.landing-page .content .info p {
    font-size: 18px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 30px;
}

.landing-page .content .info form {
    width: 100%;
    max-width: 400px;
}

.landing-page .content .info form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.landing-page .content .info form button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s;
}

.landing-page .content .info form button:hover {
    background-color: #0069d9;
}

.landing-page .content .image {
    flex: 1;
    text-align: center;
}

.landing-page .content .image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* Estilos para formularios */
.group {
    position: relative;
    margin-bottom: 45px;
}

.group input {
    font-size: 18px;
    padding: 10px 10px 10px 5px;
    display: block;
    width: 100%;
    border: none;
    border-bottom: 1px solid #757575;
    background: transparent;
}

.group input:focus {
    outline: none;
}

.group label {
    color: #999;
    font-size: 18px;
    font-weight: normal;
    position: absolute;
    pointer-events: none;
    left: 5px;
    top: 10px;
    transition: 0.2s ease all;
}

.group input:focus ~ label, .group input:valid ~ label {
    top: -20px;
    font-size: 14px;
    color: #007bff;
}

.group .bar {
    position: relative;
    display: block;
    width: 100%;
}

.group .bar:before, .group .bar:after {
    content: '';
    height: 2px;
    width: 0;
    bottom: 1px;
    position: absolute;
    background: #007bff;
    transition: 0.2s ease all;
}

.group .bar:before {
    left: 50%;
}

.group .bar:after {
    right: 50%;
}

.group input:focus ~ .bar:before, .group input:focus ~ .bar:after {
    width: 50%;
}

/* Estilos para tarjetas y elementos de dashboard */
.card {
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

.card-body {
    padding: 20px;
}

.icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

.icon-wrapper i {
    font-size: 20px;
}



@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        position: fixed;
        top: 0;
        left: 0;
        width: 250px;
        height: 100vh;
        background-color: white;
        z-index: 1050;
    }

    .sidebar.show {
        transform: translateX(0%);
    }

    .main-content {
        margin-left: 0 !important;
    }

    .landing-page .content .container {
        flex-direction: column;
        gap: 40px;
    }
}


@media (max-width: 767.98px) {
    .landing-page header .container {
        flex-direction: column;
        padding-top: 15px;
        padding-bottom: 15px;
    }
    
    .landing-page header .logo {
        margin-bottom: 15px;
    }
    
    .landing-page .content {
        padding: 40px 0;
    }
    
    .landing-page .content .info h1 {
        font-size: 36px;
    }
}

.login-form .form-footer {
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
    color: #666;
}

.login-form .form-footer a {
    color: #007bff;
    text-decoration: none;
}

.login-form .form-footer a:hover {
    text-decoration: underline;
}

.landing-page.login-page .content .info h1 {
    font-size: 42px;
    color: #222;
}

.landing-page.login-page .content .info p {
    font-size: 16px;
    color: #666;
    margin-bottom: 25px;
}

/* Estilos para el modo de control */
.control-mode-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: bold;
}

.control-human {
    background-color: #ffe082;
    color: #795548;
}

.control-bot {
    background-color: #b3e5fc;
    color: #0277bd;
}

#control-timer {
    margin-top: 5px;
    font-size: 0.85rem;
}

#timer-countdown {
    font-weight: bold;
}
/* ==========================================
   ESTILOS MODERNOS PARA EL CHAT - INTOUCHIFY
   ========================================== */

/* Variables del tema para el chat */
:root {
    --chat-primary: #128c7e;
    --chat-primary-dark: #075e54;
    --chat-secondary: #25d366;
    --chat-sent: #dcf8c6;
    --chat-received: #ffffff;
    --chat-bg: #e5ddd5;
    --chat-border: #e0e0e0;
    --chat-text: #303030;
    --chat-text-meta: #8696a0;
    --chat-shadow: rgba(0, 0, 0, 0.13);
    --chat-radius: 7.5px;
    --chat-radius-lg: 12px;
}

/* Contenedor principal del chat */
.modern-chat-container {
    display: flex;
    flex-direction: column;
    height: 600px;
    background: var(--chat-bg);
    border-radius: var(--chat-radius-lg);
    overflow: hidden;
    box-shadow: 0 2px 15px var(--chat-shadow);
    position: relative;
}

/* Header del chat */
.chat-header {
    background: linear-gradient(135deg, var(--chat-primary), var(--chat-primary-dark));
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px var(--chat-shadow);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.chat-user-info h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

.chat-user-status {
    font-size: 0.8rem;
    opacity: 0.9;
    margin: 0;
}

/* Control mode indicator */
.control-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.control-indicator.human {
    background: #ffd54f;
    color: #f57c00;
}

.control-indicator.bot {
    background: #81c784;
    color: #2e7d32;
}

.control-indicator i {
    font-size: 0.7rem;
}

/* Área de mensajes */
.chat-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--chat-bg);
    position: relative;
}

/* Scrollbar personalizada */
.chat-messages-area::-webkit-scrollbar {
    width: 6px;
}

.chat-messages-area::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages-area::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.chat-messages-area::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Contenedor de mensajes */
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 100%;
}

/* Burbujas de mensajes modernizadas */
.message-bubble {
    max-width: 70%;
    position: relative;
    animation: messageSlideIn 0.3s ease-out;
    word-wrap: break-word;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-bubble.sent {
    align-self: flex-end;
    background: var(--chat-sent);
    border-radius: var(--chat-radius) var(--chat-radius) 6px var(--chat-radius);
    margin-left: auto;
}

.message-bubble.received {
    align-self: flex-start;
    background: var(--chat-received);
    border-radius: var(--chat-radius) var(--chat-radius) var(--chat-radius) 6px;
    box-shadow: 0 1px 2px var(--chat-shadow);
}

/* Contenido del mensaje */
.message-content {
    padding: 0.75rem 1rem;
}

.message-text {
    color: var(--chat-text);
    line-height: 1.4;
    margin: 0;
    font-size: 0.9rem;
}

/* Metadata del mensaje */
.message-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 0.3rem;
    font-size: 0.7rem;
    color: var(--chat-text-meta);
}

.message-time {
    font-size: inherit;
}

/* Estados del mensaje */
.message-status {
    display: flex;
    align-items: center;
    gap: 2px;
}

.status-icon {
    font-size: 0.7rem;
    opacity: 0.7;
}

.status-icon.pending {
    color: #9e9e9e;
}

.status-icon.sent {
    color: #4caf50;
}

.status-icon.delivered {
    color: #2196f3;
}

.status-icon.read {
    color: #2196f3;
}

/* Indicador de agente */
.agent-indicator {
    font-size: 0.6rem;
    margin-left: 4px;
}

.agent-indicator.human {
    color: #ff9800;
}

.agent-indicator.bot {
    color: #4caf50;
}

/* Tipos de mensaje especiales */
.message-media {
    border-radius: var(--chat-radius);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.message-media img,
.message-media video {
    width: 100%;
    height: auto;
    display: block;
}

.message-media audio {
    width: 100%;
}

.message-document {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--chat-radius);
    margin-bottom: 0.5rem;
}

.document-icon {
    font-size: 1.5rem;
    color: var(--chat-primary);
}

/* Área de input */
.chat-input-area {
    background: white;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--chat-border);
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

.input-container {
    flex: 1;
    position: relative;
}

.chat-input {
    width: 100%;
    border: 1px solid var(--chat-border);
    border-radius: 25px;
    padding: 0.75rem 1rem;
    resize: none;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.4;
    max-height: 100px;
    min-height: 42px;
    transition: border-color 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: var(--chat-primary);
    box-shadow: 0 0 0 2px rgba(18, 140, 126, 0.1);
}

/* Botones de acción */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.action-btn.send {
    background: var(--chat-primary);
    color: white;
}

.action-btn.send:hover {
    background: var(--chat-primary-dark);
    transform: scale(1.05);
}

.action-btn.send:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.action-btn.attach {
    background: #f5f5f5;
    color: #666;
}

.action-btn.attach:hover {
    background: #eeeeee;
    color: var(--chat-primary);
}

/* Respuestas rápidas */
.quick-replies {
    padding: 0.75rem 1.5rem 0;
    background: white;
    border-top: 1px solid var(--chat-border);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-reply-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--chat-border);
    border-radius: 15px;
    background: white;
    color: var(--chat-text);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.quick-reply-btn:hover {
    background: var(--chat-primary);
    color: white;
    border-color: var(--chat-primary);
}

/* Indicador de escritura */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    background: var(--chat-received);
    border-radius: var(--chat-radius) var(--chat-radius) var(--chat-radius) 6px;
    max-width: 70%;
    align-self: flex-start;
    box-shadow: 0 1px 2px var(--chat-shadow);
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--chat-text-meta);
    animation: typingAnimation 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Alertas de estado del chat */
.chat-alert {
    padding: 0.75rem 1rem;
    margin: 0.5rem 1rem;
    border-radius: var(--chat-radius);
    text-align: center;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.chat-alert.info {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.chat-alert.warning {
    background: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffcc02;
}

.chat-alert.success {
    background: #e8f5e8;
    color: #388e3c;
    border: 1px solid #c8e6c9;
}

/* Timer del control humano */
.control-timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.timer-progress {
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.timer-bar {
    height: 100%;
    background: #ffd54f;
    transition: width 1s linear;
}

/* Responsive */
@media (max-width: 768px) {
    .modern-chat-container {
        height: calc(100vh - 120px);
        border-radius: 0;
    }
    
    .chat-header {
        padding: 0.75rem 1rem;
    }
    
    .chat-avatar {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .message-bubble {
        max-width: 85%;
    }
    
    .chat-input-area {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }
    
    .quick-replies {
        padding: 0.5rem 1rem 0;
    }
    
    .quick-reply-btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
}

/* Animaciones adicionales */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message-bubble.sent {
    animation: slideInRight 0.3s ease-out;
}

.message-bubble.received {
    animation: slideInLeft 0.3s ease-out;
}

/* Estados de conexión */
.connection-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 500;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.connection-status.connected {
    background: #4caf50;
    color: white;
}

.connection-status.disconnected {
    background: #f44336;
    color: white;
}

.connection-status.reconnecting {
    background: #ff9800;
    color: white;
}


/* Asegurar que el chat header tenga posición relativa para el posicionamiento absoluto */
.chat-header {
    position: relative;
}

/* Efecto de pulso para nuevos mensajes */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.message-bubble.new-message {
    animation: pulse 0.6s ease-out;
}

/* ==========================================
   ESTILOS PARA WHATSAPP WEB - INTOUCHIFY
   ========================================== */

/* Contenedor principal de WhatsApp Web */
.whatsapp-web-container {
    display: flex;
    height: calc(100vh - 120px);
    background: #f0f2f5;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Panel izquierdo - Lista de conversaciones */
.conversations-panel {
    width: 400px;
    min-width: 320px;
    background: white;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
}

/* Header del panel de conversaciones */
.conversations-header {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.conversations-header-info h4 {
    color: #2c3e50;
    font-weight: 600;
}

.conversations-header-actions {
    display: flex;
    gap: 0.5rem;
}

.conversations-header-actions .btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: 1px solid #e9ecef;
    color: #6c757d;
    transition: all 0.3s ease;
}

.conversations-header-actions .btn:hover {
    background: #e9ecef;
    color: #495057;
}

/* Barra de búsqueda */
.conversations-search {
    padding: 1rem 1.5rem;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

.search-container {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 0.9rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 1px solid #e9ecef;
    border-radius: 25px;
    background: #f8f9fa;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--chat-primary);
    background: white;
    box-shadow: 0 0 0 2px rgba(18, 140, 126, 0.1);
}

/* Lista de conversaciones */
.conversations-list {
    flex: 1;
    overflow-y: auto;
    background: white;
}

.conversations-list::-webkit-scrollbar {
    width: 6px;
}

.conversations-list::-webkit-scrollbar-track {
    background: transparent;
}

.conversations-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

/* Grupos de conversaciones */
.conversation-group {
    border-bottom: 1px solid #f1f3f4;
}

.group-header {
    padding: 0.75rem 1.5rem 0.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.group-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Items de conversación */
.conversation-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid #f1f3f4;
    position: relative;
}

.conversation-item:hover {
    background: #f8f9fa;
}

.conversation-item.active {
    background: #e8f5e8;
    border-left: 4px solid var(--chat-primary);
}

.conversation-item.pending {
    background: #fff3cd;
}

.conversation-item.pending.active {
    background: #ffeaa7;
}

/* Avatar de conversación */
.conversation-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chat-primary), var(--chat-primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

/* Info de conversación */
.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.conversation-name {
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-time {
    font-size: 0.75rem;
    color: #6c757d;
    flex-shrink: 0;
}

.conversation-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.message-preview {
    color: #6c757d;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 0.5rem;
}

.conversation-badges {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.conversation-badges .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

/* Panel derecho - Chat */
.chat-panel {
    flex: 1;
    background: #e5ddd5;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Pantalla de bienvenida */
.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f0f2f5;
}

.welcome-content {
    text-align: center;
    max-width: 400px;
    padding: 2rem;
}

.welcome-icon {
    font-size: 6rem;
    color: var(--chat-primary);
    margin-bottom: 1.5rem;
}

.welcome-content h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 300;
    font-size: 2rem;
}

.welcome-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.welcome-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.feature-item i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.feature-item span {
    color: #495057;
    font-weight: 500;
}

/* Ajustes para el chat en el panel derecho */
.chat-panel .modern-chat-container {
    height: 100%;
    border-radius: 0;
    background: #e5ddd5;
}

/* Header actions del chat */
.chat-header-actions {
    display: flex;
    gap: 0.5rem;
}

.chat-header-actions .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

/* Responsive para WhatsApp Web */
@media (max-width: 1024px) {
    .conversations-panel {
        width: 350px;
        min-width: 280px;
    }
}

@media (max-width: 768px) {
    .whatsapp-web-container {
        height: calc(100vh - 80px);
    }
    
    .conversations-panel {
        width: 100%;
        position: absolute;
        z-index: 1000;
        height: 100%;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .conversations-panel.show {
        transform: translateX(0);
    }
    
    .chat-panel {
        width: 100%;
    }
    
    .conversations-header {
        padding: 1rem;
    }
    
    .conversations-search {
        padding: 0.75rem 1rem;
    }
    
    .conversation-item {
        padding: 0.75rem 1rem;
    }
    
    .conversation-avatar {
        width: 40px;
        height: 40px;
        margin-right: 0.75rem;
    }
    
    /* Botón para mostrar conversaciones en móvil */
    .mobile-conversations-toggle {
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 1001;
        background: var(--chat-primary);
        color: white;
        border: none;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        transition: all 0.3s ease;
    }
    
    .mobile-conversations-toggle:hover {
        background: var(--chat-primary-dark);
        transform: scale(1.05);
    }
}

/* Efectos de animación */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.conversation-item {
    animation: slideInLeft 0.3s ease-out;
}

/* Estados de carga */
.conversation-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

.conversation-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 1rem;
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top: 2px solid var(--chat-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notificaciones en tiempo real */
.conversation-item.new-message {
    animation: pulse 1s ease-in-out;
}

@keyframes pulse {
    0% { background-color: white; }
    50% { background-color: #e8f5e8; }
    100% { background-color: white; }
}

/* Overlay para móvil */
.conversations-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.conversations-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Mejoras para accesibilidad */
.conversation-item:focus {
    outline: 2px solid var(--chat-primary);
    outline-offset: -2px;
}

.conversation-item[role="button"] {
    cursor: pointer;
}

/* Estados de conexión específicos para WhatsApp Web */
.whatsapp-web-container .connection-status {
    top: -1px;
    right: 15px;
    left: auto;
    bottom: auto;
    transform: none;
}


/* Estilos para el contador de mensajes sin leer */
.unread-count {
    background: var(--chat-primary);
    color: white;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    font-weight: 600;
}

/* Indicador de mensaje enviado/recibido en la lista */
.message-indicator {
    font-size: 0.7rem;
    margin-right: 0.25rem;
    opacity: 0.7;
}

.message-indicator.sent {
    color: var(--chat-primary);
}

.message-indicator.received {
    color: #6c757d;
}

/* Estilos para mensajes temporales */
.message-bubble.temporary-message {
    opacity: 0.8;
    position: relative;
}

.message-bubble.temporary-message::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
    animation: shimmer 2s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Estado de envío */
.message-bubble.temporary-message .status-icon.pending {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Estilos para diferenciar WebChat y WhatsApp */
.conversation-avatar.webchat {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

.conversation-avatar.whatsapp {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
}

.source-badge {
    font-size: 10px !important;
    padding: 2px 6px !important;
}

.conversation-item.new-message {
    animation: newMessagePulse 2s ease-in-out;
}

@keyframes newMessagePulse {
    0% { background-color: rgba(23, 162, 184, 0.1); }
    50% { background-color: rgba(23, 162, 184, 0.2); }
    100% { background-color: transparent; }
}

.conversation-item[data-phone*="session_"] .conversation-avatar {
    background: linear-gradient(135deg, #17a2b8, #138496);
}

.conversation-item[data-phone*="session_"]:hover {
    border-left: 3px solid #17a2b8;
}