/* Styles généraux */
.chatGP-chat-container {
    height: 100vh;
    background: white;
    display: flex;
    flex-direction: column;
}

.chatGP-chat-header {
    background: white;
    color: #333;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chatGP-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chatGP-chat-header h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.chatGP-header-actions {
    display: flex;
    gap: 15px;
}

.chatGP-sidebar-btn {
    padding: 10px;
    background: transparent;
    border: none;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.chatGP-sidebar-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.chatGP-new-btn {
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.chatGP-new-btn:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.chatGP-chat-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.chatGP-chat-panel {
    width: 80%;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    height: 90%;
    overflow: hidden;
}

.chatGP-chat-panel.full-width {
    width: 100%;
}

.chatGP-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 0;
}

.chatGP-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 80%;
}

.chatGP-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chatGP-message.assistant {
    align-self: flex-start;
}

.chatGP-message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.chatGP-message-avatar i {
    font-size: 16px;
}

.chatGP-message.chatGP-user .chatGP-message-avatar {
    background: #667eea;
    color: white;
}

.chatGP-message.chatGP-assistant .chatGP-message-avatar {
    background: #28a745;
    color: white;
}

.chatGP-message.chatGP-system .chatGP-message-avatar {
    background: #ffc107;
    color: white;
}

.chatGP-message-content {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 100%;
    word-wrap: break-word;
    line-height: 1.4;
}

.chatGP-message.chatGP-user .chatGP-message-content {
    background: #667eea;
    color: white;
}

.chatGP-message.chatGP-assistant .chatGP-message-content {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chatGP-message.chatGP-system .chatGP-message-content {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
    font-style: italic;
}

.chatGP-system-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 5px;
}

.chatGP-system-message i {
    color: #856404;
}

.chatGP-sql-query {
    background: #282c34;
    color: #61dafb;
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    overflow-x: auto;
    white-space: pre-wrap;
}

.chatGP-input-container {
    padding: 20px 30px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.chatGP-schema-selector {
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.chatGP-schema-selector label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 14px;
}

.chatGP-table-checkboxes {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.chatGP-table-checkboxes label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
    margin-bottom: 0;
    cursor: pointer;
    padding: 5px 10px;
    background: white;
    border-radius: 5px;
    transition: background 0.2s;
}

.chatGP-table-checkboxes label:hover {
    background: #e3f2fd;
}

.chatGP-table-checkboxes input[type="checkbox"] {
    cursor: pointer;
}

/* Nouveau style pour le résumé des tables */
.chatGP-table-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    width: 100%;
    margin-bottom: 10px;
}

.chatGP-table-count {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.chatGP-table-info-icon {
    color: #1976d2;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.2s;
}

.chatGP-table-info-icon:hover {
    color: #0d47a1;
}

/* Tooltip personnalisé */
.chatGP-custom-tooltip {
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    max-width: 300px;
    text-align: left;
    pointer-events: none;
}

.chatGP-custom-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

/* Styles pour le conteneur SQL - Version moderne et légère */
.chatGP-sql-container {
    margin-top: 12px;
    background: transparent;
}

.chatGP-sql-toggle-btn {
    background: #f1f3f4;
    color: #5f6368;
    border: 1px solid #dadce0;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chatGP-sql-toggle-btn:hover {
    background: #e8eaed;
    border-color: #bdc1c6;
    color: #3c4043;
}

.chatGP-sql-query {
    margin-top: 12px;
    background: #f8f9fa;
    color: #202124;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e8eaed;
    overflow-x: auto;
    text-align: left;
}

.chatGP-sql-query .sql-code {
    margin: 0;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre;
    color: #202124;
    background: transparent;
}

/* Coloration syntaxique SQL - simplifiée */
/* Les styles sont maintenant inline dans les balises <strong> */

/* Formatage des cellules de la datagrid */
.chatGP-cell-date {
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #1976d2;
    background-color: #f3f8ff;
}

.chatGP-cell-number {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #2e7d32;
    background-color: #f1f8e9;
    font-weight: 500;
}

.chatGP-cell-text {
    text-align: left;
}

.chatGP-cell-key {
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #1976d2;
    background-color: #e3f2fd;
    font-weight: 600;
}

.chatGP-cell-id {
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #666;
    background-color: #f5f5f5;
    font-weight: 500;
}


/* Ancien style supprimé - remplacé par les styles unifiés */

.chatGP-datagrid-info {
    font-size: 12px;
    color: #666;
    font-weight: normal;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

/* Styles pour le tableau HTML simple (fallback) */
.chatGP-datagrid-container .chatGP-table-wrapper {
    position: relative;
    overflow-x: auto;
}

.chatGP-datagrid-container .chatGP-simple-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.chatGP-datagrid-container .chatGP-simple-table th {
    background: #f8f9fa;
    color: #333;
    font-weight: 600;
    padding: 14px 16px;
    text-align: left;
    border-bottom: 2px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 14px;
}

.chatGP-datagrid-container .chatGP-simple-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
    line-height: 1.4;
}

.chatGP-datagrid-container .chatGP-simple-table tr:nth-child(even) {
    background: #f8f9fa;
}

.chatGP-datagrid-container .chatGP-simple-table tr:hover {
    background: #e3f2fd;
}

.chatGP-datagrid-container .chatGP-row-number {
    text-align: center;
    font-weight: 600;
    color: #666;
    width: 50px;
}

/* Styles pour le tableau HTML simple amélioré */
.chatGP-datagrid-container .chatGP-table-info {
    margin-top: 8px;
    color: #666;
    font-size: 12px;
}

.chatGP-datagrid-container .chatGP-table-info small {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatGP-datagrid-container .chatGP-table-footer {
    padding: 16px 35px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatGP-datagrid-container .chatGP-table-stats {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #666;
}

.chatGP-datagrid-container .chatGP-table-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.chatGP-datagrid-container .chatGP-simple-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.chatGP-datagrid-container .chatGP-simple-table th.sortable:hover {
    background: #e9ecef;
}

.chatGP-datagrid-container .chatGP-simple-table th.sortable span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.chatGP-datagrid-container .sort-icon {
    font-size: 10px;
    color: #999;
    transition: color 0.2s;
}

.chatGP-datagrid-container .chatGP-simple-table th.sortable:hover .sort-icon {
    color: #666;
}

.chatGP-datagrid-container .chatGP-simple-table th.sortable.sorted .sort-icon {
    color: #007bff;
}

.chatGP-datagrid-container .chatGP-simple-table th.sortable.sorted-asc .sort-icon::before {
    content: '\f0de';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
}

.chatGP-datagrid-container .chatGP-simple-table th.sortable.sorted-desc .sort-icon::before {
    content: '\f0dd';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
}

.chatGP-schema-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    color: #28a745;
    font-weight: 500;
}

.chatGP-input-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    padding: 10px 15px;
    gap: 12px;
    transition: border-color 0.3s;
}

.chatGP-input-wrapper:focus-within {
    border-color: #667eea;
}

.chatGP-attachment-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 16px;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}

.chatGP-attachment-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.chatGP-attachment-btn i {
    font-size: 16px;
}

.chatGP-message-input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 14px;
    padding: 8px 0;
    color: #333;
}

.chatGP-message-input::placeholder {
    color: #999;
}

.chatGP-send-btn {
    background: #667eea;
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s;
}

.chatGP-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chatGP-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.chatGP-send-btn i {
    font-size: 14px;
}

.chatGP-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-style: italic;
}

.chatGP-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.chatGP-error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ffcdd2;
}

.chatGP-parse-error {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 16px;
    margin: 8px 0;
}

.chatGP-error-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #856404;
    font-size: 16px;
    margin-bottom: 12px;
}

.chatGP-error-content {
    margin-bottom: 16px;
}

.chatGP-error-content p {
    margin: 0 0 12px 0;
    color: #856404;
}

.chatGP-original-content {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 12px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #495057;
    white-space: pre-wrap;
    word-break: break-word;
}

.chatGP-error-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.chatGP-retry-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.chatGP-retry-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.chatGP-retry-btn[style*="background: #6c757d"]:hover {
    background: #545b62 !important;
}

/* Styles pour l'affichage des erreurs SQL */
.chatGP-error-display {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin: 15px;
}

.chatGP-error-display h3 {
    color: #856404;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
}

.chatGP-error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 6px 8px;
    margin-bottom: 0;
    color: #721c24;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
}

.chatGP-error-details {
    background: #e2e3e5;
    border: 1px solid #d6d8db;
    border-radius: 4px;
    padding: 6px 8px;
    margin-bottom: 0;
    color: #383d41;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    max-height: 200px;
    overflow-y: auto;
}

.chatGP-error-sql {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
}

.chatGP-error-sql strong {
    color: #495057;
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

.chatGP-sql-error {
    background: #2d3748;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    overflow-x: auto;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.chatGP-error-help {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
    color: #0c5460;
}

.chatGP-error-help strong {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #0c5460;
}

.chatGP-error-help ul {
    margin: 0;
    padding-left: 20px;
}

.chatGP-error-help li {
    margin-bottom: 5px;
    color: #0c5460;
}


.chatGP-preview-panel {
    width: 70%;
    background: white;
    border-left: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
    height: 100%;
    overflow: hidden;
    padding: 10px;
}

.chatGP-preview-header {
    padding: 20px 20px 25px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: white;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatGP-preview-header h2 {
    margin: 0;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatGP-preview-actions {
    position: relative;
}

.chatGP-hamburger-btn {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
}

.chatGP-hamburger-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.chatGP-preview-menu {
    position: absolute;
    top: 45px;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 220px;
    z-index: 1000;
    overflow: hidden;
}

.chatGP-menu-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
    font-size: 14px;
}

.chatGP-menu-item:hover {
    background: #f8f9fa;
    color: #667eea;
}

.chatGP-menu-item i {
    width: 20px;
    text-align: center;
}

.chatGP-ai-explanation {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    margin: 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.chatGP-ai-explanation i {
    font-size: 18px;
    opacity: 0.9;
}

.chatGP-preview-content {
    flex: 1;
    padding: 25px 0px 20px 0px;
    overflow-y: auto;
    min-height: 0;
}

.chatGP-preview-empty {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px 20px;
    margin: 0 20px;
}

.chatGP-attachment-preview {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    display: none;
}

.chatGP-attachment-preview.active {
    display: block;
}

.chatGP-attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.chatGP-attachment-item img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 4px;
}

.chatGP-attachment-item span {
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chatGP-attachment-remove {
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.chatGP-attachment-remove:hover {
    background: #cc0000;
}

.chatGP-history-panel {
    width: 20%;
    background: white;
    border-right: 1px solid #e0e0e0;
    display: none;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.chatGP-history-panel.active {
    display: flex;
}

.chatGP-history-header {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.chatGP-history-header h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatGP-search-container {
    position: relative;
    margin-top: 8px;
}

.chatGP-search-input {
    width: 100%;
    padding: 8px 12px 8px 35px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    background: white;
    transition: all 0.2s;
    outline: none;
}

.chatGP-search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.chatGP-search-input::placeholder {
    color: #999;
    font-size: 12px;
}

.chatGP-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 12px;
    pointer-events: none;
}

.chatGP-clear-search {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.2s;
    opacity: 0;
    visibility: hidden;
}

.chatGP-search-input:not(:placeholder-shown) + .chatGP-search-icon + .chatGP-clear-search {
    opacity: 1;
    visibility: visible;
}

.chatGP-clear-search:hover {
    background: #f0f0f0;
    color: #666;
}

.chatGP-search-highlight {
    background: #fff3cd;
    color: #856404;
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: 500;
}

.chatGP-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    min-height: 0;
}

.chatGP-history-item {
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid transparent;
    position: relative;
}

.chatGP-history-item:hover {
    background: #e3f2fd;
    border-color: #bbdefb;
}

.chatGP-history-item.active {
    background: #e3f2fd;
    border-color: #1976d2;
}

.chatGP-history-item-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.chatGP-history-item:hover .chatGP-history-item-actions {
    opacity: 1;
}

.chatGP-history-item-rename,
.chatGP-history-item-delete {
    background: #666;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.2s;
}

.chatGP-history-item-rename:hover {
    background: #007bff;
    transform: scale(1.1);
}

.chatGP-history-item-delete {
    background: #ff4444;
}

.chatGP-history-item-delete:hover {
    background: #cc0000;
    transform: scale(1.1);
}

.chatGP-history-item-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.chatGP-history-item-date {
    font-size: 12px;
    color: #666;
}

/* Styles pour l'affichage des résultats JSON */
.chatGP-result-display {
    margin-top: 20px;
    border-top: 1px solid #e0e0e0;
    padding-top: 15px;
}

.chatGP-result-display h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatGP-json-result {
    margin: 10px 20px 20px 20px;
}

/* Anciens styles supprimés - remplacés par les styles unifiés */

/* Ancien style supprimé - remplacé par les styles unifiés */

.chatGP-table-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chatGP-page-size-select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 12px;
}

.chatGP-pagination-info {
    display: flex;
    align-items: center;
    gap: 5px;
}

.chatGP-pagination-text {
    font-size: 12px;
    color: #666;
    margin-right: 10px;
}

.chatGP-pagination-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 8px;
    cursor: pointer;
    font-size: 12px;
    color: #333;
}

.chatGP-pagination-btn:hover:not(:disabled) {
    background: #e9ecef;
}

.chatGP-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chatGP-table-wrapper {
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
    position: relative;
}

.chatGP-advanced-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.chatGP-advanced-table th {
    background: #f8f9fa;
    padding: 12px 8px;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
    color: #333;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
}

.chatGP-advanced-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.chatGP-advanced-table th.sortable:hover {
    background: #e9ecef;
}

.chatGP-advanced-table th.row-number {
    width: 50px;
    text-align: center;
}

.chatGP-sort-icon {
    margin-left: 5px;
    font-size: 10px;
    opacity: 0.6;
}

.chatGP-advanced-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    vertical-align: top;
}

.chatGP-advanced-table td.row-number {
    text-align: center;
    font-weight: 500;
    color: #666;
    background: #f8f9fa;
}

.chatGP-advanced-table tr.even {
    background: #f9f9f9;
}

.chatGP-advanced-table tr.odd {
    background: white;
}

.chatGP-advanced-table tr:hover {
    background: #e3f2fd !important;
}

.chatGP-advanced-table tr:hover td.row-number {
    background: #bbdefb !important;
}

/* Personnalisation de la DataGrid EasyUI */
.chatGP-easyui-datagrid {
    border: none !important;
}

.chatGP-easyui-datagrid .datagrid-header {
    background: #f8f9fa !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

.chatGP-easyui-datagrid .datagrid-header-row {
    background: #f8f9fa !important;
}

.chatGP-easyui-datagrid .datagrid-header td {
    background: #f8f9fa !important;
    border-right: 1px solid #e0e0e0 !important;
    font-weight: 600 !important;
    color: #333 !important;
}

.chatGP-easyui-datagrid .datagrid-body tr:hover {
    background: #e3f2fd !important;
}

.chatGP-easyui-datagrid .datagrid-body tr.selected {
    background: #bbdefb !important;
}

.chatGP-easyui-datagrid .datagrid-body td {
    border-right: 1px solid #f0f0f0 !important;
    padding: 8px !important;
}

.chatGP-easyui-datagrid .datagrid-pager {
    background: #f8f9fa !important;
    border-top: 1px solid #e0e0e0 !important;
}

/* Styles pour les objets et valeurs simples */
.chatGP-json-object, .chatGP-json-simple {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.chatGP-json-header {
    background: #e3f2fd;
    padding: 8px 12px;
    font-weight: 500;
    color: #1976d2;
    border-bottom: 1px solid #e0e0e0;
}

.chatGP-json-content {
    padding: 12px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #333;
    white-space: pre-wrap;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.chatGP-json-error {
    background: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ffcdd2;
}

.chatGP-no-data {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* Tableau simple en fallback */
.chatGP-simple-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #e0e0e0;
}

.chatGP-simple-table th {
    background: #f8f9fa;
    padding: 12px 10px;
    border: 1px solid #e0e0e0;
    font-weight: 600;
    color: #333;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 14px;
}

.chatGP-simple-table td {
    padding: 10px;
    border: 1px solid #f0f0f0;
    color: #333;
    font-size: 14px;
}

.chatGP-simple-table tr:nth-child(even) {
    background: #f8f9fa;
}

.chatGP-simple-table tr:hover {
    background: #e3f2fd;
}

.chatGP-error-display {
    margin-top: 20px;
    border-top: 1px solid #e0e0e0;
    padding-top: 15px;
}

.chatGP-error-display h3 {
    margin: 0 0 10px 0;
    color: #d32f2f;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatGP-error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ffcdd2;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.chatGP-result-info {
    text-align: center;
    color: #666;
    padding: 20px;
    font-style: italic;
}

/* Responsive */
@media (max-width: 1200px) {
    .chatGP-preview-panel {
        width: 300px;
    }
}

@media (max-width: 768px) {
    .chatGP-chat-body {
        flex-direction: column;
    }
    
    .chatGP-preview-panel,
    .chatGP-history-panel {
        width: 100%;
        height: 300px;
    }
    
    .chatGP-message {
        max-width: 95%;
    }
}

/* Styles pour la vue GROUP BY (DataGrid + Flexmonster) */
.chatGP-groupby-container {
    margin: 10px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chatGP-datagrid-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

/* Anciens styles supprimés - remplacés par les styles unifiés */

.chatGP-datagrid-content {
    padding: 0;
}

.chatGP-flexmonster-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

/* Ancien style supprimé - remplacé par les styles unifiés */

/* Ancien style supprimé - remplacé par les styles unifiés */

/* Ancien style supprimé - remplacé par les styles unifiés */

.chatGP-flexmonster-info {
    font-size: 12px;
    color: #666;
    font-weight: normal;
    background: #e3f2fd;
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid #bbdefb;
    margin-left: 10px;
}

.chatGP-flexmonster-actions {
    display: flex;
    gap: 10px;
}

.chatGP-toggle-view-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.chatGP-toggle-view-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.chatGP-flexmonster-view {
    width: 100%;
    background: white;
    position: relative;
    overflow: hidden;
    z-index: 10;
}

/* Styles unifiés pour les deux conteneurs */
.chatGP-datagrid-container,
.chatGP-flexmonster-container {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Forcer le masquage de la DataGrid quand Flexmonster est actif */
.chatGP-flexmonster-container[style*="display: block"] ~ .chatGP-preview-content,
.chatGP-flexmonster-container:not([style*="display: none"]) ~ .chatGP-preview-content {
    display: none !important;
}

/* Alternative: masquer la DataGrid quand le conteneur Flexmonster est visible */
.chatGP-preview-content.hidden-for-flexmonster {
    display: none !important;
}

/* Styles unifiés pour les deux headers */
.chatGP-datagrid-header,
.chatGP-flexmonster-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
}

.chatGP-datagrid-title,
.chatGP-flexmonster-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
}

/* Alignement du hamburger dans les headers */
.chatGP-datagrid-header .chatGP-preview-actions,
.chatGP-flexmonster-header .chatGP-preview-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatGP-result-count {
    background: #e3f2fd;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: #1565c0;
}

.chatGP-flexmonster-content {
    padding: 20px;
    min-height: 600px;
}

/* Assurer que Flexmonster est visible */
.chatGP-flexmonster-content .fm-ui-container {
    width: 100% !important;
    height: 100% !important;
    min-height: 500px !important;
}

.chatGP-flexmonster-content #fm-pivot-view {
    width: 100% !important;
    height: 100% !important;
    min-height: 500px !important;
}

.chatGP-flexmonster-table {
    width: 100%;
}

.chatGP-flexmonster-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 500px;
    background: #f8f9fa;
    color: #666;
    font-size: 16px;
    gap: 10px;
}

/* Styles pour le tableau pivot HTML (fallback) */
.chatGP-pivot-info {
    padding: 15px 20px;
    background: #e3f2fd;
    border-bottom: 1px solid #bbdefb;
    color: #1565c0;
}

.chatGP-pivot-info h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatGP-pivot-info p {
    margin: 5px 0;
    font-size: 14px;
}

.chatGP-pivot-table-container {
    padding: 20px;
    overflow-x: auto;
}

.chatGP-pivot-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.chatGP-pivot-table th {
    background: #f8f9fa;
    color: #333;
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid #e0e0e0;
    font-size: 14px;
}

.chatGP-pivot-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.chatGP-pivot-table tbody tr:hover {
    background: #f8f9fa;
}

.chatGP-pivot-table tfoot tr {
    background: #e8f5e8 !important;
    color: #2e7d32;
    font-weight: bold;
}

.chatGP-pivot-fallback {
    padding: 20px;
    text-align: center;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 10px 0;
}

.chatGP-pivot-fallback p {
    margin: 10px 0;
}

/* Responsive pour Flexmonster */
@media (max-width: 768px) {
    /* Ancien style supprimé - remplacé par les styles unifiés */
    
    .chatGP-flexmonster-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

.chatGP-datagrid-container > .datagrid > .datagrid-wrap {
    border: 0;
}

/* ============================================ */
/* STYLES POUR RÉSULTATS INLINE DANS LE CHAT */
/* ============================================ */

/* Messages avec résultats inline */
.chatGP-message-result {
    margin-top: 15px;
    border-top: 1px solid #e0e0e0;
    padding-top: 15px;
}

/* Nombre simple dans le chat */
.chatGP-result-number {
    display: inline-block;
    font-size: 48px;
    font-weight: bold;
    color: #667eea;
    padding: 20px 40px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    text-align: center;
    margin: 10px 0;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

/* Tableau compact dans le chat */
.chatGP-inline-table {
    max-height: 500px;
    overflow: auto;
    margin: 10px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: white;
}

.chatGP-inline-table .chatGP-simple-table {
    margin: 0;
}

/* Graphique ChartJS dans le chat */
.chatGP-inline-chart {
    max-width: 700px;
    max-height: 450px;
    margin: 15px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.chatGP-inline-chart canvas {
    max-height: 400px;
}

/* Container pour Flexmonster inline */
.chatGP-inline-flexmonster {
    margin: 15px 0;
    min-height: 450px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    background: white;
}

/* Ajustements pour les messages avec résultats */
.chatGP-message.chatGP-assistant .chatGP-message-content {
    max-width: 100%;
}

/* Responsive pour les résultats inline */
@media (max-width: 1200px) {
    .chatGP-inline-chart {
        max-width: 100%;
    }
    
    .chatGP-result-number {
        font-size: 36px;
        padding: 15px 30px;
    }
}

@media (max-width: 768px) {
    .chatGP-result-number {
        font-size: 28px;
        padding: 12px 20px;
    }
    
    .chatGP-inline-table {
        max-height: 300px;
    }
    
    .chatGP-inline-chart {
        padding: 10px;
    }
}
