/* Styles pour l'interface d'administration CRM */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
    color: #333;
}

/* Support des emojis */
* {
    font-family: inherit;
}

.emoji {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "Android Emoji", "EmojiSymbols", "EmojiOne Mozilla", "Twemoji Mozilla", "Segoe UI", sans-serif;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header h1 {
    color: #1a202c;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.system-info {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.client-info, .instance-info {
    color: #718096;
    font-size: 0.875rem;
}

.status-indicator {
    color: #48bb78;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Navigation Tabs */
.tabs {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0 2rem;
    display: flex;
    gap: 0;
    overflow-x: auto;
}

.tab {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "Android Emoji", "EmojiSymbols", "EmojiOne Mozilla", "Twemoji Mozilla", "Segoe UI", system-ui, -apple-system, sans-serif;
}

.tab:hover {
    background: rgba(59, 130, 246, 0.05);
    color: #3b82f6;
}

.tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

/* Main Content */
.content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block !important;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.service-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.service-card.main {
    border: 2px solid #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(59, 130, 246, 0.02) 100%);
}

.service-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.service-header i {
    font-size: 1.5rem;
    color: #3b82f6;
}

.service-name {
    font-weight: 600;
    color: #1a202c;
    font-size: 1.1rem;
}

.status-badge {
    margin-left: auto;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
}

.status-badge[style*="color: #10b981"] {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.status-badge[style*="color: #ef4444"] {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.status-badge[style*="color: #f59e0b"] {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.service-card p {
    color: #64748b;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.service-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
    justify-content: center;
}

.btn.primary {
    background: #3b82f6;
    color: white;
}

.btn.primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn.secondary {
    background: rgba(0, 0, 0, 0.05);
    color: #374151;
}

.btn.secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

.credentials {
    margin-top: 0.5rem;
}

.credentials small {
    color: #6b7280;
    font-size: 0.8rem;
}

.credentials code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
}

/* Footer Styles */
.footer {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    color: #e2e8f0;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-section p {
    margin: 0.25rem 0;
    color: #cbd5e0;
    font-size: 0.875rem;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.btn.disabled {
    background: rgba(0, 0, 0, 0.1);
    color: #6b7280;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn.disabled:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: none;
    box-shadow: none;
}

/* Sections spécialisées */
.data-section, .dev-section, .monitoring-section, .security-section {
    margin-bottom: 2rem;
}

.data-section h3, .dev-section h3, .monitoring-section h3, .security-section h3 {
    color: #1a202c;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Actions groupées */
.bulk-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.bulk-actions .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
}

/* Grille de métriques */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.metric-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
}

.metric-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

.metric-header i {
    color: #3b82f6;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 1rem;
}

.metric-chart {
    height: 60px;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 0.8rem;
}

/* Gestion des utilisateurs */
.user-management {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: 1.5rem;
}

.user-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    text-align: center;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 8px;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 500;
}

.user-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Outils d'audit */
.audit-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.audit-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.audit-card h4 {
    color: #1a202c;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.audit-card p {
    color: #64748b;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.audit-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Grille de scripts */
.scripts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.script-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.script-card h4 {
    color: #1a202c;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.script-card p {
    color: #64748b;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.script-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Indicateur de chargement */
.loading {
    text-align: center;
    padding: 2rem;
    color: #64748b;
    font-style: italic;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #1a202c;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1a202c;
}

.modal-body {
    padding: 1.5rem;
}

.db-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.db-info {
    background: rgba(59, 130, 246, 0.05);
    padding: 1rem;
    border-radius: 8px;
}

.db-info h4 {
    margin: 0 0 1rem 0;
    color: #1a202c;
    font-size: 1rem;
}

.db-info p {
    margin: 0.5rem 0;
    color: #374151;
}

/* Progression pour l'ajout/suppression de services */
.progress-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.progress-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #1a202c;
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #64748b;
    transition: all 0.3s ease;
}

.step i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.step.active {
    color: #3b82f6;
    font-weight: 500;
}

.step.active i {
    color: #3b82f6;
}

.step.completed {
    color: #10b981;
}

.step.completed i {
    color: #10b981;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Notifications */
.notification {
    transition: transform 0.3s ease;
}

/* Cartes de conteneurs */
.container-card {
    border-left: 4px solid #10b981;
}

.container-card .status-badge.online {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.container-card .status-badge.offline {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Détails des conteneurs */
.container-details {
    margin: 1rem 0;
}

.detail-row {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 4px;
}

.detail-row strong {
    color: #374151;
    font-weight: 500;
}

.detail-row code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
}

/* Section d'informations de connexion */
.connection-info-section {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.connection-info-section h5 {
    margin: 0 0 1rem 0;
    color: #1a202c;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.connection-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.connection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.connection-item strong {
    color: #374151;
    font-weight: 500;
    flex-shrink: 0;
}

.connection-item code {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

/* Badges de protocole */
.protocol-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.protocol-badge.http {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.protocol-badge.tcp {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.protocol-badge.http-s3 {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.protocol-badge.amqp-http {
    background: rgba(139, 69, 19, 0.1);
    color: #8b4513;
}

/* URL de connexion avec bouton copier */
.connection-url {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.url-code {
    flex: 1;
    background: rgba(59, 130, 246, 0.1) !important;
    color: #3b82f6 !important;
    padding: 0.25rem 0.5rem !important;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem !important;
    font-weight: 500;
    word-break: break-all;
}

.btn-copy {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    padding: 0.25rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

.btn-copy:hover {
    background: #3b82f6;
    color: white;
    transform: scale(1.05);
}

.btn-copy i {
    font-size: 0.8rem;
}

/* Grille de détails du conteneur */
.container-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.detail-section {
    background: rgba(59, 130, 246, 0.05);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.detail-section h4 {
    margin: 0 0 1rem 0;
    color: #1a202c;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-item {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.detail-item strong {
    color: #374151;
    font-weight: 500;
}

.detail-item:last-child {
    margin-bottom: 0;
}

/* Responsive pour les détails de conteneur */
@media (max-width: 768px) {
    .connection-details {
        grid-template-columns: 1fr;
    }

    .connection-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .connection-url {
        width: 100%;
    }

    .container-details-grid {
        grid-template-columns: 1fr;
    }
}

/* Indicateurs de statut */
.status-badge.online {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.status-badge.offline {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.status-badge.loading {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

/* Indicateur de statut global */
.status-indicator.online {
    color: #10b981;
}

.status-indicator.offline {
    color: #ef4444;
}

.status-indicator {
    color: #f59e0b;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .system-info {
        justify-content: center;
    }

    .tabs {
        padding: 0 1rem;
    }

    .tab {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }

    .content {
        padding: 1rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .bulk-actions {
        flex-direction: column;
    }

    .bulk-actions .btn {
        width: 100%;
    }

    .user-actions {
        flex-direction: column;
    }

    .user-actions .btn {
        width: 100%;
    }

    .audit-actions {
        flex-direction: column;
    }

    .audit-actions .btn {
        width: 100%;
    }

    .script-actions {
        flex-direction: column;
    }

    .script-actions .btn {
        width: 100%;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Section Connexions */
.connections-section {
    color: #1a202c;
}

.connections-intro {
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 2rem;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.connection-category {
    margin-bottom: 3rem;
}

.connection-category h4 {
    color: #1a202c;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.connection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.connection-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.connection-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.connection-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.connection-header i {
    font-size: 1.5rem;
    color: #3b82f6;
}

.connection-name {
    font-weight: 600;
    color: #1a202c;
    font-size: 1.1rem;
}

.connection-details {
    margin-bottom: 1rem;
}

.connection-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.9rem;
}

.connection-info:last-child {
    border-bottom: none;
}

.connection-info strong {
    color: #374151;
    font-weight: 500;
}

.connection-info code {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    font-weight: 500;
}

.connection-info .password {
    cursor: pointer;
    transition: all 0.3s ease;
}

.connection-info .password:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.connection-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.connection-summary {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: 2rem;
}

.connection-summary h4 {
    color: #1a202c;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 8px;
}

.summary-label {
    color: #64748b;
    font-size: 0.9rem;
}

.summary-value {
    color: #1a202c;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Responsive pour les connexions */
@media (max-width: 768px) {
    .connection-grid {
        grid-template-columns: 1fr;
    }

    .connection-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }
}

/* Styles pour l'en-tête des connexions */
.connections-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.connections-header h3 {
    color: #1a202c;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.connections-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.connections-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.connections-actions .btn-primary {
    background: #3b82f6;
    color: white;
    border: none;
}

.connections-actions .btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.connections-actions .btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: #374151;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.connections-actions .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Responsive pour l'en-tête des connexions */
@media (max-width: 768px) {
    .connections-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .connections-actions {
        width: 100%;
        justify-content: center;
    }
}

/* ===========================================
   STYLES UNIVERSELS MODERNES - TOUTES SECTIONS
   =========================================== */

/* Section container générique */
.modern-section {
    padding: 2.5rem;
    max-width: 1600px;
    margin: 0 auto;
    background: linear-gradient(to bottom, #f8fafc 0%, #ffffff 100%);
}

/* Header de section avec gradient */
.modern-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    flex-wrap: wrap;
    gap: 1.5rem;
}

.modern-header h3 {
    color: white;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modern-header .actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.modern-header .btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    backdrop-filter: blur(10px);
    font-weight: 600;
    transition: all 0.3s ease;
}

.modern-header .btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Introduction/description */
.modern-intro {
    color: #475569;
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 2.5rem;
    text-align: center;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding: 1rem 2rem;
    background: white;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Grille de statistiques */
.modern-stats {
    margin-bottom: 3rem;
}

.modern-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.modern-stat-card {
    position: relative;
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.modern-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 16px 0 0;
}

.modern-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

.modern-stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.modern-stat-content {
    flex: 1;
}

.modern-stat-number {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modern-stat-label {
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Grille de cartes/conteneurs */
.modern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Carte moderne générique */
.modern-card {
    background: linear-gradient(to bottom, #ffffff 0%, #f9fafb 100%);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 2px solid #e5e7eb;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.modern-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modern-card:hover::before {
    opacity: 1;
}

.modern-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.25);
    border-color: #667eea;
}

.modern-card-header {
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.modern-card-icon {
    width: 65px;
    height: 65px;
    border-radius: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.modern-card:hover .modern-card-icon {
    transform: rotate(10deg) scale(1.1);
}

.modern-card-title {
    flex: 1;
}

.modern-card-title h4 {
    color: #1e293b;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.modern-card-title p {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
}

.modern-card-body {
    padding: 2rem;
}

.modern-card-footer {
    padding: 1.5rem 2rem;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Catégories/groupes */
.modern-category {
    margin-bottom: 0;
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    border: 2px solid #e5e7eb;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

.modern-category:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.modern-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 1rem;
}

.modern-category-header h4 {
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* États vides */
.modern-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 3rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 16px;
    border: 3px dashed #cbd5e1;
    transition: all 0.3s ease;
}

.modern-empty:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.modern-empty i {
    font-size: 4rem;
    color: #94a3b8;
    margin-bottom: 1.5rem;
    display: block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.modern-empty p {
    color: #64748b;
    font-size: 1.15rem;
    font-weight: 500;
    margin-bottom: 2rem;
}

.modern-empty .btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.85rem 2rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.modern-empty .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

/* Styles pour service-info dans les cartes */
.service-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    font-weight: 600;
    color: #64748b;
    font-size: 0.9rem;
}

.info-row code {
    background: #f1f5f9;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #1e293b;
}

.info-row .btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.info-row .btn-icon:hover {
    background: #f8fafc;
    border-color: #667eea;
    color: #667eea;
}

/* Status badges dans les cartes modernes */
.modern-card-header .status-badge {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.status-badge.status-active {
    background: #10b981;
    color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-badge.status-pending {
    background: #f59e0b;
    color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.status-badge.status-error {
    background: #ef4444;
    color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

/* Badges de status dans le body */
.badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Bulk actions buttons group */
.bulk-actions-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.bulk-actions-group .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Alert boxes */
.alert-box {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.alert-box.alert-warning {
    border-left: 4px solid #f59e0b;
}

.alert-box.alert-info {
    border-left: 4px solid #3b82f6;
}

.alert-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #1f2937;
}

.alert-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.alert-list li {
    padding: 0.5rem 0;
    color: #4b5563;
    font-size: 0.95rem;
}

/* Connections wrapper styling */
.connections-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.connection-category {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.connection-category h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.connection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.connection-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.connection-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.connection-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
}

.connection-header i {
    font-size: 1.5rem;
    color: #667eea;
}

.connection-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
}

.connection-details {
    margin-bottom: 1rem;
}

.connection-info {
    padding: 0.4rem 0;
    font-size: 0.9rem;
}

.connection-info strong {
    color: #4b5563;
    margin-right: 0.5rem;
}

.connection-info code {
    background: #f3f4f6;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.connection-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Styles pour les métriques en temps réel */
.metric-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.metric-value-large {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.metric-chart {
    width: 100%;
    height: 120px;
    background: #f8fafc;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-chart canvas {
    max-width: 100%;
    max-height: 100%;
}

/* Animation pour les cartes métriques */
.modern-card.metric-card {
    min-height: 300px;
}

.modern-card.metric-card .modern-card-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
}

/* ===========================================
   STYLES POUR L'ONGLET INSTANCES APPLI
   =========================================== */

.instances-section {
    padding: 2.5rem;
    max-width: 1600px;
    margin: 0 auto;
    background: linear-gradient(to bottom, #f8fafc 0%, #ffffff 100%);
}

.instances-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    flex-wrap: wrap;
    gap: 1.5rem;
}

.instances-header h3 {
    color: white;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.instances-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.instances-actions .btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    backdrop-filter: blur(10px);
    font-weight: 600;
    transition: all 0.3s ease;
}

.instances-actions .btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.instances-intro {
    color: #475569;
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 2.5rem;
    text-align: center;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding: 1rem 2rem;
    background: white;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Statistiques des instances */
.instances-stats {
    margin-bottom: 3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    position: relative;
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.stat-icon {
    font-size: 2.5rem;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Grille des catégories d'instances (NGINX, API, Dashboard) */
.instances-categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
    justify-content: flex-start;
}

/* Catégories d'instances - Largeur fixe standard */
.instance-category {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    margin-bottom: 0;
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    border: 2px solid #e5e7eb;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

.instance-category:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 1rem;
}

.category-header h4 {
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.instance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Sur grand écran, limite à 3 colonnes pour la lisibilité */
@supports (grid-template-columns: repeat(auto-fill, minmax(280px, 1fr))) {
    .instance-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    }
}

/* Cartes d'instance */
.instance-card {
    background: linear-gradient(to bottom, #ffffff 0%, #f9fafb 100%);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 2px solid #e5e7eb;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.instance-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.instance-card:hover::before {
    opacity: 1;
}

.instance-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.25);
    border-color: #667eea;
}

.instance-header {
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.instance-icon {
    font-size: 2rem;
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.instance-card:hover .instance-icon {
    transform: rotate(10deg) scale(1.1);
}

.instance-info {
    flex: 1;
    min-width: 0;
}

.instance-info h5 {
    margin: 0 0 0.75rem 0;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.instance-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.instance-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status-running {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.status-running::before {
    background: #10b981;
}

.status-stopped {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.status-stopped::before {
    background: #ef4444;
}

.instance-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.btn-icon {
    background: white;
    border: 2px solid #e5e7eb;
    padding: 0.65rem;
    border-radius: 10px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.btn-icon:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-icon.btn-danger:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.instance-details {
    padding: 2rem;
    background: white;
}

.instance-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.instance-detail:last-child {
    border-bottom: none;
}

.instance-detail .label {
    font-weight: 600;
    color: #64748b;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.instance-detail .label::before {
    content: '•';
    color: #667eea;
    font-size: 1.5rem;
}

.instance-detail .value {
    color: #1e293b;
    font-weight: 700;
    font-size: 1rem;
    font-family: 'Monaco', 'Courier New', monospace;
    background: #f1f5f9;
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
}

/* États vides */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 3rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 16px;
    border: 3px dashed #cbd5e1;
    transition: all 0.3s ease;
}

.empty-state:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.empty-state i {
    font-size: 4rem;
    color: #94a3b8;
    margin-bottom: 1.5rem;
    display: block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.empty-state p {
    color: #64748b;
    font-size: 1.15rem;
    font-weight: 500;
    margin-bottom: 2rem;
}

.empty-state .btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.85rem 2rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.empty-state .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

/* Actions globales */
.instances-actions-global {
    margin-bottom: 3rem;
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    border: 2px solid #e5e7eb;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.instances-actions-global h4 {
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.actions-grid .btn {
    padding: 1.25rem 2rem;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 12px;
    border: 2px solid;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.actions-grid .btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Logs et monitoring */
.instances-logs {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 2px solid #334155;
}

.instances-logs h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
}

.logs-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.log-section,
.monitoring-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.log-section h5,
.monitoring-section h5 {
    color: #e2e8f0;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.log-entries {
    max-height: 300px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
}

.log-entry {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: #94a3b8;
    flex-shrink: 0;
    font-weight: 600;
}

.log-message {
    color: #e2e8f0;
}

.instances-logs h4 {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.logs-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.log-section h5,
.monitoring-section h5 {
    color: #e5e7eb;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.log-entries {
    background: #374151;
    border-radius: 8px;
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.log-entry {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #4b5563;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: #9ca3af;
    font-size: 0.8rem;
    font-family: monospace;
    min-width: 140px;
}

.log-message {
    color: #e5e7eb;
    flex: 1;
}

.monitoring-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn.primary {
    background: #3b82f6;
    color: white;
}

.btn.primary:hover {
    background: #2563eb;
}

.btn.success {
    background: #10b981;
    color: white;
}

.btn.success:hover {
    background: #059669;
}

.btn.warning {
    background: #f59e0b;
    color: white;
}

.btn.warning:hover {
    background: #d97706;
}

.btn.info {
    background: #06b6d4;
    color: white;
}

.btn.info:hover {
    background: #0891b2;
}

.btn.secondary {
    background: #6b7280;
    color: white;
}

.btn.secondary:hover {
    background: #4b5563;
}

.btn.danger {
    background: #ef4444;
    color: white;
}

.btn.danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* Responsive pour l'onglet instances */
@media (max-width: 768px) {
    .instances-section {
        padding: 1rem;
    }

    .instances-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .instances-actions {
        width: 100%;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .instance-grid {
        grid-template-columns: 1fr;
    }

    .logs-container {
        grid-template-columns: 1fr;
    }

    .actions-grid {
        grid-template-columns: 1fr;
    }

    .instance-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .instance-actions {
        align-self: flex-end;
    }
}

/* ========================================
   INSTALLATION MANAGER STYLES - v2.1.0
   ======================================== */

/* Installation Section */
.installation-section {
    padding: 2rem;
}

.installation-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.installation-header h2 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.section-description {
    color: #666;
    font-size: 0.95rem;
}

/* Active Tasks */
.active-tasks-section {
    margin-bottom: 2rem;
}

.active-tasks-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-monitor {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.task-header h4 {
    margin: 0;
    color: #333;
}

.task-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s;
}

.btn-icon:hover {
    background: #f0f0f0;
}

.btn-icon.danger:hover {
    background: #fee;
    color: #d32f2f;
}

.task-body {
    padding: 0.5rem 0;
}

.task-info {
    margin-bottom: 1rem;
}

.task-info p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.task-info strong {
    color: #555;
}

.status-running {
    color: #2196F3;
    font-weight: bold;
}

.status-completed {
    color: #4CAF50;
    font-weight: bold;
}

.status-failed {
    color: #f44336;
    font-weight: bold;
}

.status-stopped {
    color: #FF9800;
    font-weight: bold;
}

.task-progress {
    margin-top: 1rem;
}

.progress-bar {
    background: #e0e0e0;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    width: 0%;
    transition: width 0.3s;
    animation: progress-animation 2s infinite;
}

@keyframes progress-animation {
    0% { width: 0%; }
    50% { width: 100%; }
    100% { width: 0%; }
}

/* Scripts Grid */
.installation-scripts {
    margin: 2rem 0;
}

.script-category {
    margin-bottom: 3rem;
}

.script-category h3 {
    color: #667eea;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.scripts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.script-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 2px solid transparent;
}

.script-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.script-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.script-header h4 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.script-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge.complexity {
    background: #E3F2FD;
    color: #1976D2;
}

.badge.danger {
    background: #FFEBEE;
    color: #D32F2F;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.script-description {
    color: #666;
    font-size: 0.9rem;
    margin: 1rem 0;
    line-height: 1.5;
}

.script-meta {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    padding: 0.5rem 0;
    border-top: 1px solid #e0e0e0;
    font-size: 0.85rem;
    color: #888;
}

.script-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Modal Dialogs */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
}

.modal-content.modal-large {
    max-width: 900px;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

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

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Details Table */
.details-table {
    width: 100%;
    border-collapse: collapse;
}

.details-table th,
.details-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.details-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #555;
    width: 35%;
}

.details-table td {
    color: #333;
}

.details-table code {
    background: #f5f5f5;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Logs Viewer */
.logs-viewer {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1.5rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    max-height: 500px;
    overflow: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Execution History */
.execution-history {
    margin: 2rem 0;
}

.execution-history h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

/* Documentation */
.installation-docs {
    margin: 2rem 0;
}

.installation-docs h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.doc-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.doc-card h4 {
    color: #333;
    margin-bottom: 0.5rem;
}

.doc-card p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Alerts - Enhanced */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
}

.alert.info {
    background: #E3F2FD;
    border-left: 4px solid #2196F3;
    color: #1565C0;
}

.alert.warning {
    background: #FFF3E0;
    border-left: 4px solid #FF9800;
    color: #E65100;
}

.alert.warning h4 {
    margin-top: 0;
    color: #E65100;
}

.alert.warning ul {
    margin: 0.5rem 0 0 1.5rem;
}

.alert.warning li {
    margin: 0.25rem 0;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 3rem;
    color: #667eea;
    font-size: 1.2rem;
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .scripts-grid {
        grid-template-columns: 1fr;
    }
    
    .docs-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .script-actions {
        flex-direction: column;
    }
}
