/* Panneau principal - utilise les mêmes styles que les modals existantes */
            .memory-manager-panel {
                position: fixed;
                right: -520px;
                top: 0;
                width: 500px;
                height: 100vh;
                background: var(--bg-primary, #1a1a2e);
                box-shadow: -2px 0 20px rgba(0,0,0,0.3);
                z-index: 10000;
                display: flex;
                flex-direction: column;
                transition: right 0.3s ease;
                font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            }
            
            .memory-manager-panel.open {
                right: 0;
            }
            
            /* Header avec gradient comme dans l'app */
            .memory-panel-header {
                padding: 20px;
                background: var(--primary-color);
                color: #e0e0e0;
                display: flex;
                justify-content: space-between;
                align-items: center;
            }
            
            .memory-panel-header h2 {
                margin: 0;
                font-size: 1.3rem;
                font-weight: 600;
            }
            
            /* Bouton fermer cohérent */
            .memory-panel-header .close-btn {
                background: var(--primary-color);
                border: none;
                color: #e0e0e0;
                width: 32px;
                height: 32px;
                cursor: pointer;
                transition: all 0.2s;
                display: flex;
                align-items: center;
                justify-content: center;
            }
            
            .memory-panel-header .close-btn:hover {
                background: var(--primary-color);
                transform: scale(1.05);
            }
            
            /* Onglets style dark */
            .memory-panel-tabs {
                display: flex;
                background: var(--primary-color);
                border-bottom: 1px solid rgba(255,255,255,0.1);
            }
            
            .memory-panel-tabs .tab-btn {
                flex: 1;
                padding: 12px 8px;
                background: transparent;
                border: none;
                color: #9ca3af;
                cursor: pointer;
                transition: all 0.2s;
                border-bottom: 2px solid transparent;
                font-size: 0.85rem;
            }
            
            .memory-panel-tabs .tab-btn:hover {
                background: rgba(255,255,255,0.05);
                color: #e0e0e0;
            }
            
            .memory-panel-tabs .tab-btn.active {
                color: #60a5fa;
                border-bottom-color: var(--secondary-color);;
                background: rgba(59, 130, 246, 0.1);
            }
            
            /* Contenu avec scroll */
            .memory-panel-content {
                flex: 1;
                overflow-y: auto;
                padding: 20px;
                background: var(--primary-color);
            }
            
            /* Tabs */
            .memory-tab {
                display: none;
            }
            
            .memory-tab.active {
                display: block;
            }
            
            /* Inputs et boutons cohérents avec le thème */
            .search-input-group {
                display: flex;
                gap: 10px;
                margin-bottom: 15px;
            }
            
            .search-input-group input {
                flex: 1;
                padding: 10px 12px;
                background: rgba(255, 255, 255, 0.1);
                border: 1px solid rgba(255,255,255,0.1);
                border-radius: 6px;
                color: #e0e0e0;
                font-size: 0.9rem;
            }
            
            .search-input-group input:focus {
                outline: none;
                border-color: var(--secondary-color);
                box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
            }
            
            .search-input-group button {
                padding: 10px 20px;
                background: var(--secondary-color);
                color: white;
                border: none;
                border-radius: 6px;
                cursor: pointer;
                font-weight: 500;
                transition: transform 0.2s;
            }
            
            .search-input-group button:hover {
                transform: translateY(-1px);
                box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
            }
            
            /* Select et filtres */
            .search-filters {
                display: flex;
                gap: 10px;
                margin-bottom: 20px;
            }
            
            .search-filters select,
            .search-filters input {
                padding: 8px 12px;
                background: rgba(255, 255, 255, 0.1);
                border: 1px solid rgba(255,255,255,0.1);
                border-radius: 4px;
                color: #e0e0e0;
                font-size: 0.85rem;
            }
            
            /* Résultats de recherche */
            .memory-result-item {
                background: rgba(255, 255, 255, 0.1);
                padding: 15px;
                margin-bottom: 10px;
                border-radius: 8px;
                cursor: pointer;
                transition: all 0.2s;
            }
            
            .memory-result-item:hover {
                background: rgba(255, 255, 255, 0.1);
                border-color: var(--secondary-color);;
                transform: translateX(5px);
            }
            
            .memory-result-header {
                display: flex;
                justify-content: space-between;
                margin-bottom: 10px;
                color: #ffffffff;
                font-weight: 600;
                font-size: 0.9rem;
            }
            
            .memory-result-content {
                color: #9ca3af;
                font-size: 0.85rem;
                line-height: 1.5;
            }
            
            /* Stats cards */
            .mem-stats-overview {
                display: grid;
                grid-template-columns: repeat(2, 1fr);
                gap: 15px;
                margin-bottom: 30px;
            }
            
            .mem-stat-card {
                background: rgba(255, 255, 255, 0.1);
                padding: 20px;
                border-radius: 8px;
                text-align: center;
                border: 1px solid rgba(255,255,255,0.1);
                transition: transform 0.2s;
            }
            
            .mem-stat-card:hover {
                transform: translateY(-2px);
                border-color: var(--secondary-color);;
            }
            
            .mem-stat-card i {
                font-size: 1.8rem;
                color: var(--secondary-color);;
                margin-bottom: 10px;
            }
            
            .mem-stat-value {
                font-size: 1.8rem;
                font-weight: bold;
                color: #e0e0e0;
                margin: 10px 0 5px;
            }
            
            .mem-stat-label {
                color: #6b7280;
                font-size: 0.8rem;
                text-transform: uppercase;
                letter-spacing: 0.5px;
            }
            
            /* Actions buttons */
            .mem-action-btn {
                display: flex;
                align-items: center;
                gap: 15px;
                padding: 15px;
                background: rgba(255, 255, 255, 0.1);
                border: 1px solid rgba(255,255,255,0.1);
                border-radius: 8px;
                cursor: pointer;
                transition: all 0.2s;
                text-align: left;
                width: 100%;
                margin-bottom: 10px;
            }
            
            .mem-action-btn:hover {
                background: rgba(255, 255, 255, 0.1);
                border-color: var(--secondary-color);;
                transform: translateX(5px);
            }
            
            .mem-action-btn i {
                font-size: 1.3rem;
                color: #60a5fa;
            }
            
            .mem-action-btn span {
                font-weight: 600;
                color: #e0e0e0;
                display: block;
            }
            
            .mem-action-btn small {
                color: #6b7280;
                font-size: 0.8rem;
                display: block;
                margin-top: 2px;
            }
            
            .mem-action-btn.danger {
                border-color: rgba(239, 68, 68, 0.3);
            }
            
            .mem-action-btn.danger i {
                color: #ef4444;
            }
            
            .mem-action-btn.danger:hover {
                background: rgba(239, 68, 68, 0.1);
                border-color: #ef4444;
            }
            
            /* Placeholder */
            .placeholder {
                text-align: center;
                color: #6b7280;
                padding: 40px 20px;
                font-style: italic;
            }
            
            /* Topics chips */
            .mem-topic-chip {
                display: inline-block;
                background: rgba(255, 255, 255, 0.1);
                padding: 8px 15px;
                border-radius: 20px;
                font-size: 0.85rem;
                color: #9ca3af;
                margin: 5px;
                border: 1px solid rgba(255,255,255,0.1);
            }
            
            .mem-topic-chip span {
                background: var(--secondary-color);;
                color: white;
                padding: 2px 8px;
                border-radius: 12px;
                margin-left: 8px;
                font-size: 0.75rem;
            }
            
            /* Settings */
            .memory-settings {
                margin-top: 30px;
            }
            
            .memory-settings h3 {
                color: #e0e0e0;
                margin-bottom: 20px;
            }
            
            .mem-setting-item {
                display: flex;
                align-items: center;
                gap: 10px;
                margin-bottom: 15px;
                color: #9ca3af;
            }
            
            .mem-setting-item input[type="checkbox"] {
                width: 18px;
                height: 18px;
                accent-color: var(--secondary-color);
            }
            
            .mem-setting-item input[type="number"] {
                width: 60px;
                padding: 5px 8px;
                background: rgba(255, 255, 255, 0.1);
                border: 1px solid rgba(255,255,255,0.1);
                border-radius: 4px;
                color: #e0e0e0;
            }

            /* Header avec tooltip */
            .mem-header-with-tooltip {
                display: flex;
                align-items: center;
                gap: 10px;
            }

            .mem-info-tooltip-btn {
                background: var(--primary-color);
                border: none;
                color: #9ca3af;
                width: 24px;
                height: 24px;
                cursor: pointer;
                display: flex;
                align-items: center;
                justify-content: center;
            }

            .mem-info-tooltip-btn:hover {
                background: var(--primary-color);
                color: #60a5fa;
                transform: scale(1.1);
            }

            /* Tooltip */
            .memory-info-tooltip {
                position: absolute;
                top: 60px;
                left: 20px;
                right: 20px;
                background: var(--primary-color);
                border-radius: 12px;
                padding: 20px;
                box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
                z-index: 1000;
            }

            .mem-tooltip-content h3 {
                margin: 0 0 15px 0;
                color: #60a5fa;
                font-size: 1.1rem;
            }

            .mem-info-section {
                margin-bottom: 15px;
                padding-bottom: 15px;
                border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            }

            .mem-info-section:last-of-type {
                border-bottom: none;
            }

            .mem-info-section strong {
                display: block;
                color: #e0e0e0;
                margin-bottom: 8px;
                font-size: 0.95rem;
            }

            .mem-info-section p {
                color: #9ca3af;
                font-size: 0.85rem;
                line-height: 1.5;
                margin: 5px 0;
            }

            .mem-info-section ul {
                margin: 5px 0;
                padding-left: 20px;
                color: #9ca3af;
                font-size: 0.85rem;
            }

            .mem-info-section li {
                margin: 5px 0;
                line-height: 1.4;
            }

            .mem-close-tooltip {
                width: 100%;
                padding: 10px;
                margin-top: 10px;
                background: linear-gradient(135deg, #3b82f6, #2563eb);
                color: white;
                border: none;
                border-radius: 6px;
                cursor: pointer;
                font-weight: 500;
                transition: all 0.2s;
            }

            .mem-close-tooltip:hover {
                transform: translateY(-1px);
                box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
            }

            @keyframes fadeIn {
                from {
                    opacity: 0;
                    transform: translateY(-10px);
                }
                to {
                    opacity: 1;
                    transform: translateY(0);
                }
            }

            /* Conversations tab */
            .mem-conversations-section {
                padding: 10px 0;
            }

            .mem-conversations-header {
                display: flex;
                justify-content: space-between;
                align-items: center;
                margin-bottom: 20px;
            }

            .mem-conversations-header h3 {
                color: #e0e0e0;
                margin: 0;
            }

            .mem-conversations-header select {
                padding: 8px 12px;
                background: rgba(255, 255, 255, 0.1);
                border: 1px solid rgba(255,255,255,0.1);
                border-radius: 4px;
                color: #e0e0e0;
            }

            .mem-conversations-list {
                max-height: 800px;
                overflow-y: auto;
            }

            .mem-conversation-item {
                background: rgba(255, 255, 255, 0.05);
                border: 1px solid rgba(255,255,255,0.1);
                border-radius: 8px;
                padding: 15px;
                margin-bottom: 10px;
                cursor: pointer;
                transition: all 0.2s;
            }

            .mem-conversation-item:hover {
                background: rgba(255, 255, 255, 0.1);
                transform: translateX(5px);
                border-color: var(--secondary-color);
            }

            .mem-conv-header {
                display: flex;
                justify-content: space-between;
                margin-bottom: 8px;
            }

            .mem-conv-header strong {
                color: #e0e0e0;
            }

            .mem-conv-date {
                color: #9ca3af;
                font-size: 0.85rem;
            }

            .mem-conv-meta {
                display: flex;
                gap: 20px;
                font-size: 0.85rem;
                color: #6b7280;
            }

            .mem-conv-meta i {
                margin-right: 5px;
            }

            /* Détails de conversation */
            .mem-conversation-details {
                padding: 10px 0;
            }

            .mem-conv-detail-header {
                display: flex;
                align-items: center;
                gap: 15px;
                margin-bottom: 20px;
            }

            .mem-back-btn {
                background: rgba(255, 255, 255, 0.1);
                border: 1px solid rgba(255,255,255,0.1);
                color: #9ca3af;
                padding: 8px 12px;
                border-radius: 6px;
                cursor: pointer;
                transition: all 0.2s;
            }

            .mem-back-btn:hover {
                background: rgba(255, 255, 255, 0.15);
                color: #e0e0e0;
            }

            .mem-conv-detail-header h3 {
                color: #e0e0e0;
                margin: 0;
                flex: 1;
            }

            .mem-conv-detail-meta {
                background: rgba(255, 255, 255, 0.05);
                padding: 15px;
                border-radius: 8px;
                margin-bottom: 20px;
            }

            .mem-conv-detail-meta p {
                margin: 5px 0;
                color: #9ca3af;
            }

            .mem-conv-messages {
                margin-bottom: 20px;
            }

            .mem-conv-messages h4 {
                color: #e0e0e0;
                margin-bottom: 15px;
            }

            .mem-conv-message {
                background: rgba(255, 255, 255, 0.05);
                padding: 12px;
                margin-bottom: 10px;
                border-radius: 8px;
                border-left: 3px solid transparent;
            }

            .mem-conv-message.user {
                border-left-color: #60a5fa;
            }

            .mem-conv-message.assistant {
                border-left-color: #34d399;
            }

            .mem-conv-message strong {
                color: #e0e0e0;
                display: block;
                margin-bottom: 5px;
            }

            .mem-conv-message p {
                color: #9ca3af;
                margin: 5px 0;
            }

            .mem-conv-message small {
                color: #6b7280;
            }

            .mem-clear-conv-btn {
                background: rgba(239, 68, 68, 0.1);
                border: 1px solid rgba(239, 68, 68, 0.3);
                color: #ef4444;
                padding: 8px 12px;
                border-radius: 6px;
                cursor: pointer;
                transition: all 0.2s;
                font-size: 0.85rem;
                display: flex;
                align-items: center;
                gap: 5px;
            }

            .mem-clear-conv-btn:hover {
                background: rgba(239, 68, 68, 0.2);
                border-color: #ef4444;
                transform: translateY(-1px);
            }

            .mem-clear-conv-btn i {
                font-size: 0.9rem;
            }

            .mem-tooltip-content {
                max-height: 70vh;
                overflow-y: auto;
                position: relative;
            }

            .mem-tooltip-scrollable {
                padding-right: 10px;
            }

            /* Personnaliser la scrollbar */
            .mem-tooltip-content::-webkit-scrollbar {
                width: 8px;
            }

            .mem-tooltip-content::-webkit-scrollbar-track {
                background: rgba(255, 255, 255, 0.05);
                border-radius: 4px;
            }

            .mem-tooltip-content::-webkit-scrollbar-thumb {
                background: rgba(255, 255, 255, 0.2);
                border-radius: 4px;
            }

            .mem-tooltip-content::-webkit-scrollbar-thumb:hover {
                background: rgba(255, 255, 255, 0.3);
            }

            .mem-conv-messages::-webkit-scrollbar {
                width: 8px;
            }

            .mem-conv-messages::-webkit-scrollbar-track {
                background: rgba(255, 255, 255, 0.05);
                border-radius: 4px;
            }

            .mem-conv-messages::-webkit-scrollbar-thumb {
                background: rgba(255, 255, 255, 0.2);
                border-radius: 4px;
            }

            .mem-conv-messages::-webkit-scrollbar-thumb:hover {
                background: rgba(255, 255, 255, 0.3);
            }

            .mem-conv-relative{
                color: white;
            }

.memory-used-alert {
    background: var(--primary-color);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: slideIn 0.3s ease-out;
}

.memory-details-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.memory-details-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.memory-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s;
}

.memory-details-content {
    background: white;
    border-radius: 12px;
    padding: 25px;
    max-width: 800px;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.memory-detail-item {
    background: #f7f9fb;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.memory-detail-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
}

.memory-score {
    background: #DC714A;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.memory-detail-meta {
    color: #718096;
    margin-bottom: 10px;
}

.memory-detail-content {
    color: #2d3748;
    line-height: 1.6;
}

.mem-param-help {
    background: var(--primary-color);
    border: none;
    color: #9ca3af;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mem-param-help:hover {
    background: var(--primary-color);
    color: #60a5fa;
    transform: scale(1.1);
}

/* Tooltip content avec z-index très élevé */
.mem-param-help .mem-tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    max-width: 250px;
    z-index: 999999;  /* Z-index très élevé pour être toujours devant */
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Alternative : tooltip plus large */
.mem-param-help .mem-tooltip-content.wide {
    white-space: normal;
    width: 250px;
    text-align: left;
    line-height: 1.4;
    z-index: 999999;  /* Même z-index élevé pour les tooltips larges */
}

/* Flèche du tooltip */
.mem-param-help .mem-tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 999999;  /* Même z-index pour la flèche */
}

/* Afficher le tooltip au survol */
.mem-param-help:hover .mem-tooltip-content {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
    z-index: 999999;  /* Assurer que le z-index reste élevé */
}

.rag-trends-section {
    padding: 20px;
}

.rag-trends-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.rag-trends-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.rag-trends-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rag-trend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rag-trend-item:hover {
    background: rgba(59, 130, 246, 0.1);
    transform: translateX(5px);
}

.rag-trend-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.rag-trend-content strong {
    color: white;
    font-size: 1.05em;
}

.rag-trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85em;
    color: #9ca3af;
}

.rag-trend-badge.trending-up {
    color: #DC714A;
}

.rag-trend-badge i {
    font-size: 0.9em;
}

.rag-trend-action {
    color: #60a5fa;
    font-size: 1.2em;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.rag-trend-item:hover .rag-trend-action {
    opacity: 1;
}