/* ===========================
   MAINTENANCE GENIUS - Admin CSS v2.9.124
   Design moderne avec onglets et personnalisation
   Branding : Chakra Racine N°1 — Orange #F97316
   =========================== */

/* ========================================
   VARIABLES CSS — Chakra Racine N°1 (v2.9.73)
   Brand : Maintenance GENIUS — Suite GENIUS™
   Réf brandbook : BRANDING_1001GENIUS.md v1.2
   ======================================== */
.mg-wrapper {
    --mg-primary:          #F97316;  /* Orange Racine vif */
    --mg-primary-dark:     #C2410C;  /* Hover/active */
    --mg-primary-light:    #FED7AA;  /* Backgrounds subtils */
    --mg-primary-gradient: linear-gradient(135deg, #F97316 0%, #EA580C 100%);

    --mg-pro:              #f39c12;  /* PRO badge — décision §18 #7 (à trancher) */
    --mg-pro-dark:         #e67e22;
    --mg-pro-gradient:     linear-gradient(135deg, #f39c12 0%, #e67e22 100%);

    --mg-text:             #1f2937;
    --mg-text-muted:       #6b7280;
    --mg-border:           #e5e7eb;
}

/* ========================================
   RESET & BOX-SIZING GLOBAL (v2.6.38)
   Correction du débordement des accordéons
   ======================================== */
.mg-wrapper,
.mg-wrapper *,
.mg-wrapper *::before,
.mg-wrapper *::after {
    box-sizing: border-box;
}

/* ========================================
   CACHER LE FOOTER WORDPRESS ADMIN (v2.6.37)
   Le texte "Merci de faire de WordPress..." était intrusif
   ======================================== */
.toplevel_page_maintenance-genius #wpfooter,
.maintenance-genius_page_maintenance-genius #wpfooter {
    display: none !important;
}

/* Étendre le contenu pour occuper tout l'espace */
.toplevel_page_maintenance-genius #wpcontent,
.maintenance-genius_page_maintenance-genius #wpcontent {
    padding-bottom: 20px !important;
}

/* ========================================
   TOOLTIPS PERSONNALISÉS (v2.6.3)
   Utilise JS pour éviter les problèmes de coupure
   ======================================== */

/* Tooltip container (généré par JS) */
.mg-tooltip-box {
    position: fixed;
    z-index: 999999;
    padding: 10px 14px;
    background: linear-gradient(135deg, #2d3436 0%, #1e272e 100%);
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    max-width: 280px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: left;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mg-tooltip-box.visible {
    opacity: 1;
}

.mg-tooltip-box::after {
    content: '';
    position: absolute;
    border: 8px solid transparent;
}

.mg-tooltip-box.arrow-bottom::after {
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: #1e272e;
}

.mg-tooltip-box.arrow-top::after {
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: #1e272e;
}

/* Icône info pour les tooltips */
.mg-field-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .4px;
    line-height: 1.7;
    color: #fff;
    background: linear-gradient(135deg, #F97316 0%, #C2410C 100%);
    border-radius: 999px;
    vertical-align: middle;
}
.mg-field-tag--soft {
    background: #e2e8f0;
    color: #475569;
}

.mg-info-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #F97316 0%, #C2410C 100%);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    margin-left: 6px;
    cursor: help;
    vertical-align: middle;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.mg-info-tooltip:hover {
    background: linear-gradient(135deg, #a366bd 0%, #8855b5 100%);
    transform: scale(1.1);
}

/* Reset et base */
.mg-wrapper {
    margin: 20px 20px 0 0;
}

/* Badge PRO */
.mg-pro-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
    box-shadow: 0 2px 4px rgba(243, 156, 18, 0.3);
}

/* Badge licence active dans le header */
.mg-license-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 15px;
    margin-left: 10px;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.4);
}

.mg-license-badge svg {
    width: 14px;
    height: 14px;
}

/* Fonctionnalités PRO verrouillées */
.mg-pro-locked {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
    user-select: none;
}

.mg-pro-locked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0, 0, 0, 0.03) 10px,
        rgba(0, 0, 0, 0.03) 20px
    );
    border-radius: 8px;
    pointer-events: none;
}

.mg-pro-locked-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: #fff;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
    z-index: 10;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mg-pro-locked-overlay:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.5);
}

/* Carte PRO dans l'onglet PRO */
.mg-pro-card {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border: 2px solid #f39c12;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    text-align: center;
}

.mg-pro-card h3 {
    color: #d68910;
    font-size: 24px;
    margin-bottom: 15px;
}

.mg-pro-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.mg-pro-feature-item {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    text-align: left;
    transition: all 0.3s ease;
}

.mg-pro-feature-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.mg-pro-feature-item h4 {
    color: #F97316;
    font-size: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mg-pro-feature-item p {
    color: #666;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.mg-pro-cta {
    margin-top: 30px;
}

.mg-pro-cta .mg-btn-pro {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
    text-decoration: none;
    display: inline-block;
}

.mg-pro-cta .mg-btn-pro:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.5);
}

.mg-pro-price {
    font-size: 36px;
    font-weight: 700;
    color: #e67e22;
    margin: 20px 0 10px;
}

.mg-pro-price-note {
    color: #888;
    font-size: 13px;
}

/* Licence form */
.mg-license-form {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
}

.mg-license-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.mg-license-form input[type="text"] {
    width: 100%;
    max-width: 400px;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: monospace;
    transition: border-color 0.3s ease;
}

.mg-license-form input[type="text"]:focus {
    border-color: #F97316;
    outline: none;
}

.mg-license-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 15px;
}

.mg-license-status.active {
    background: #d4edda;
    color: #155724;
}

.mg-license-status.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Upload zone pour image de fond */
.mg-upload-zone {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.mg-upload-zone:hover {
    border-color: #F97316;
    background: #faf8fc;
}

.mg-upload-preview {
    width: 100%;
    max-width: 400px;
    height: 200px;
    margin: 0 auto 15px;
    border-radius: 8px;
    overflow: hidden;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mg-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mg-upload-placeholder {
    color: #6c757d;
    font-size: 14px;
}

.mg-upload-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
}

/* Header avec gradient */
.mg-header {
    background: linear-gradient(135deg, #F97316 0%, #FED7AA 100%);
    padding: 35px 40px;
    box-shadow: 0 4px 20px rgba(147, 83, 172, 0.3);
    margin-bottom: 0;
}

.mg-header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.mg-header-left h1 {
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

.mg-version {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.mg-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mg-toggle-label {
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Toggle moderne */
.mg-switch-modern {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 32px;
}

.mg-switch-modern input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mg-slider-modern {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.3);
    transition: .4s;
    border-radius: 32px;
}

.mg-slider-modern:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .mg-slider-modern {
    background-color: #4CAF50;
}

input:checked + .mg-slider-modern:before {
    transform: translateX(28px);
}

/* Badge status */
.mg-status-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    min-width: 60px;
    text-align: center;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.mg-status-badge.active {
    background: linear-gradient(135deg, #00d26a 0%, #00bf60 100%);
    box-shadow: 0 0 20px rgba(0, 210, 106, 0.6), 
                0 0 40px rgba(0, 210, 106, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: mg-pulse-glow 2s ease-in-out infinite;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.mg-status-badge.inactive {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: none;
}

@keyframes mg-pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 210, 106, 0.6), 
                    0 0 40px rgba(0, 210, 106, 0.3),
                    inset 0 1px 0 rgba(255, 255, 255, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 210, 106, 0.8), 
                    0 0 60px rgba(0, 210, 106, 0.5),
                    inset 0 1px 0 rgba(255, 255, 255, 0.4);
        transform: scale(1.05);
    }
}

/* Onglets */
.mg-tabs-wrapper {
    background: #ffffff;
    border-bottom: 2px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.mg-tabs {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    gap: 5px;
}

.mg-tab {
    background: transparent;
    border: none;
    padding: 18px 30px;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    position: relative;
}

.mg-tab:hover {
    color: #F97316;
    background: rgba(147, 83, 172, 0.05);
}

.mg-tab.active {
    color: #F97316;
    border-bottom-color: #F97316;
    background: rgba(147, 83, 172, 0.08);
}

/* Contenu principal */
.mg-content {
    max-width: 1400px;
    margin: 30px auto 40px;
    padding: 0 40px; /* v2.6.40 - Aligné avec header et tabs (était 20px) */
    width: 100%;
}

/* Tab content - v2.6.38 layout fix */
.mg-tab-content {
    display: none;
    width: 100%;
}

.mg-tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

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

/* Card */
.mg-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    overflow: visible; /* v2.6.38 - Permettre le contenu visible */
}

.mg-card-header {
    background: #f8f9fa;
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.mg-card-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #F97316;
}

.mg-card-body {
    padding: 30px;
    background: #fff;
    border-radius: 0 0 12px 12px;
}

/* v2.6.38 - Accordéons doivent respecter leur conteneur */
.mg-card-body .mg-accordion {
    width: 100%;
    max-width: 100%;
}

/* Section title */
.mg-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #F97316;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* Form groups */
.mg-form-group {
    margin-bottom: 25px;
}

.mg-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.mg-form-group input[type="text"],
.mg-form-group input[type="password"],
.mg-form-group textarea,
.mg-form-group select {
    width: 100%;
    max-width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    font-family: inherit;
    box-sizing: border-box;
    min-height: 48px;
}

#mg-visitor-duration { max-width: 500px; }
.mg-vad-custom { max-width: 500px; }

.mg-form-group input:focus,
.mg-form-group textarea:focus,
.mg-form-group select:focus {
    outline: none;
    border-color: #F97316;
}

.mg-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.mg-form-group select {
    cursor: pointer;
}

.mg-field-description {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* Form row (2 colonnes) */
.mg-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.mg-form-row .mg-form-group {
    margin-bottom: 0;
}

.mg-form-group.mg-half {
    flex: 1;
}

/* Color picker WordPress */
.mg-color-picker {
    max-width: 200px !important;
}

.wp-picker-container {
    max-width: 200px;
}

.wp-picker-container .wp-color-result {
    height: 40px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: border-color 0.3s;
}

.wp-picker-container .wp-color-result:hover {
    border-color: #F97316;
}

/* Range slider */
.mg-range-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mg-range-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.mg-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #F97316;
    cursor: pointer;
    transition: all 0.3s;
}

.mg-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 8px rgba(147, 83, 172, 0.1);
}

.mg-range-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #F97316;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.mg-range-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 8px rgba(147, 83, 172, 0.1);
}

.mg-range-value {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: #F97316;
    font-size: 15px;
}

/* PRO hint text */
.mg-pro-hint {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
    font-style: italic;
}

/* Range input dans le container */
.mg-range-container input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.mg-range-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #F97316;
    cursor: pointer;
    transition: all 0.3s;
}

.mg-range-container input[type="range"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mg-range-container input[type="range"]:disabled::-webkit-slider-thumb {
    background: #999;
    cursor: not-allowed;
}

/* Checkbox custom */
.mg-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    color: #333;
}

.mg-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Logo upload */
.mg-logo-upload {
    max-width: 100%;
}

.mg-logo-preview,
.mg-bg-image-preview {
    margin-bottom: 15px;
    padding: 20px;
    background: #f8f9fa;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    text-align: center;
}

.mg-logo-placeholder {
    margin-bottom: 15px;
    padding: 30px 20px;
    background: #f8f9fa;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    text-align: center;
}

.mg-logo-placeholder p {
    margin: 10px 0 0;
    color: #999;
    font-size: 13px;
}

.mg-logo-preview img {
    max-width: 200px;
    max-height: 100px;
    height: auto;
}

.mg-bg-image-preview img {
    max-width: 100%;
    max-height: 200px;
    height: auto;
    border-radius: 4px;
}

.mg-logo-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Separateur */
.mg-separator {
    height: 1px;
    background: linear-gradient(to right, transparent, #e0e0e0, transparent);
    margin: 30px 0;
}

/* Boutons */
.mg-btn {
    display: inline-block;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.mg-btn-primary {
    background: linear-gradient(135deg, #FB923C 0%, #EA580C 100%);
    color: #ffffff;
}

.mg-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.mg-btn-secondary {
    background: #6c757d;
    color: #ffffff;
}

.mg-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.mg-btn-danger {
    background: #dc3545;
    color: #ffffff;
}

.mg-btn-danger:hover {
    background: #c82333;
}

.mg-btn-warning {
    background: #ff9800;
    color: #ffffff;
}

.mg-btn-warning:hover {
    background: #e68900;
    transform: translateY(-2px);
}

/* IMPORTANT: Bouton reset ROUGE */
button#mg-reset-design.mg-btn.mg-btn-secondary {
    background: #dc3545 !important;
    color: #ffffff !important;
}

button#mg-reset-design.mg-btn.mg-btn-secondary:hover {
    background: #c82333 !important;
    transform: translateY(-2px) !important;
}

/* Form actions */
.mg-form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
}

/* Contrôles d'opacité */
.mg-opacity-control {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.mg-opacity-control label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
}

/* Section actions */
.mg-section-actions {
    margin: 25px 0;
    text-align: right;
}

.mg-section-actions .mg-btn {
    min-width: 200px;
}

/* Footer */
/* Footer → see v2.6.37 block below */

/* Responsive */
@media (max-width: 782px) {
    .mg-wrapper {
        margin: 10px 10px 0 0;
    }

    .mg-header {
        padding: 25px 20px;
    }

    .mg-header-content {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }

    .mg-header-right {
        width: 100%;
        justify-content: space-between;
    }

    .mg-tabs {
        padding: 0 20px;
        overflow-x: auto;
    }

    .mg-tab {
        padding: 15px 20px;
        font-size: 14px;
        white-space: nowrap;
    }

    .mg-content {
        padding: 0 20px;
    }

    .mg-card-body {
        padding: 20px;
    }

    .mg-form-row {
        flex-direction: column;
        gap: 0;
    }

    .mg-form-row .mg-form-group {
        margin-bottom: 25px;
    }

    .mg-form-actions {
        flex-direction: column;
    }

    .mg-btn {
        width: 100%;
        text-align: center;
    }

    .mg-logo-buttons {
        flex-direction: column;
    }
}

/* ========================================
   PRESETS DESIGN
   ======================================== */
.mg-presets-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 1200px) {
    .mg-presets-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .mg-presets-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .mg-presets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.mg-preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mg-preset-btn:hover {
    border-color: #F97316;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(147, 83, 172, 0.25);
}

.mg-preset-btn.active {
    border-color: #F97316;
    background: linear-gradient(135deg, #f8f4fa 0%, #f0e8f5 100%);
    box-shadow: 0 4px 12px rgba(147, 83, 172, 0.2);
}

.mg-preset-preview {
    width: 100%;
    height: 50px;
    border-radius: 6px;
    margin-bottom: 8px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

/* Simuler un mini container dans le preview */
.mg-preset-preview::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    background: rgba(255,255,255,0.9);
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.mg-preset-name {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ========================================
   CHECKBOX GRID (Accès)
   ======================================== */
.mg-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.mg-checkbox-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.mg-checkbox-grid .mg-checkbox-label {
    margin: 0;
    padding: 8px 12px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}

.mg-checkbox-grid .mg-checkbox-label:hover {
    border-color: #F97316;
}

.mg-checkbox-grid .mg-checkbox-label small {
    display: block;
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}

/* ========================================
   LOGS TABLE
   ======================================== */
.mg-logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.mg-logs-table th,
.mg-logs-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.mg-logs-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.mg-logs-table tr:hover {
    background: #f8f9fa;
}

.mg-logs-table td:first-child {
    white-space: nowrap;
    font-size: 12px;
    color: #666;
}

.mg-logs-table td:nth-child(2) {
    font-family: monospace;
    font-size: 12px;
}

.mg-logs-table td:nth-child(3) {
    color: #e94560;
    font-weight: 500;
}

.mg-logs-table td:nth-child(4) {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: #888;
}

/* ========================================
   TEXTAREA ACCESS
   ======================================== */
#tab-access textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: monospace;
    font-size: 13px;
    resize: vertical;
    transition: border-color 0.3s;
}

#tab-access textarea:focus {
    outline: none;
    border-color: #F97316;
}

#tab-access textarea::placeholder {
    color: #aaa;
}

/* ========================================
   PASSWORD FIELD - Toggle & Copy (v2.5.1)
   ======================================== */

/* Wrapper */
.mg-password-field-wrapper {
    position: relative;
    max-width: 500px;
}

/* Input group */
.mg-password-input-group {
    display: flex;
    align-items: stretch;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
    min-height: 48px;
    background: #fff;
}

.mg-password-input-group:focus-within {
    border-color: #F97316;
    box-shadow: 0 0 0 3px rgba(147, 83, 172, 0.1);
}

/* Input - Override default styles */
.mg-form-group .mg-password-input {
    flex: 1;
    border: none !important;
    padding: 12px 15px !important;
    font-size: 14px !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    min-width: 0;
    border-radius: 0 !important;
}

.mg-form-group .mg-password-input:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* Actions container */
.mg-password-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
    background: #f8f9fa;
    border-left: 1px solid #e0e0e0;
}

/* Buttons base */
.mg-password-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mg-password-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.mg-password-btn:focus {
    outline: 2px solid #F97316;
    outline-offset: -2px;
}

.mg-copy-password:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.mg-copy-password:disabled:hover {
    background: transparent;
    color: #666;
}

/* Toggle active state */
.mg-toggle-password.active {
    color: #F97316;
    background: rgba(147, 83, 172, 0.1);
}

/* Copy success state */
.mg-copy-password.copied {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

/* Generate button */
.mg-generate-password:hover {
    color: #F97316;
    background: rgba(147, 83, 172, 0.1);
}

.mg-generate-password.generating {
    animation: mg-spin 0.5s ease;
}

@keyframes mg-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Status message */
.mg-password-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.mg-password-status .mg-status-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.mg-password-status.mg-status-success {
    color: #4CAF50;
}

.mg-password-status.mg-status-success strong {
    color: #4CAF50;
}

/* Toast notification */
.mg-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #333 0%, #1a1a1a 100%);
    color: #fff;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99999;
}

.mg-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 600px) {
    .mg-password-field-wrapper {
        max-width: 100%;
    }
    
    .mg-password-actions {
        padding: 4px;
    }
    
    .mg-password-toggle,
    .mg-password-copy,
    .mg-password-generate {
        width: 32px;
        height: 32px;
    }
    
    .mg-password-toggle svg,
    .mg-password-copy svg,
    .mg-password-generate svg {
        width: 16px;
        height: 16px;
    }
}

/* ========================================
   ACCÈS PERSONNALISÉS (v2.5.1)
   ======================================== */

/* Stats cards */
.mg-access-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.mg-stat-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.mg-stat-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #F97316;
    line-height: 1;
}

.mg-stat-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Config bar */
.mg-access-config {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.mg-access-limit {
    font-size: 13px;
    color: #666;
}

.mg-access-limit strong {
    color: #F97316;
}

.mg-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.mg-btn-icon:hover {
    background: #e0e0e0;
    color: #333;
}

/* Tokens table */
.mg-tokens-table-wrapper {
    overflow-x: auto;
}

.mg-tokens-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.mg-tokens-table th,
.mg-tokens-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.mg-tokens-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.mg-tokens-table tr:hover {
    background: #fafafa;
}

.mg-tokens-table .mg-token-name {
    font-weight: 600;
    color: #333;
}

.mg-tokens-table .mg-token-email {
    font-size: 11px;
    color: #888;
    display: block;
}

.mg-tokens-table .mg-token-expired {
    opacity: 0.5;
}

.mg-tokens-table .mg-token-expired td {
    color: #999;
}

.mg-token-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.mg-token-status.active {
    background: #4CAF50;
}

.mg-token-status.expired {
    background: #dc3545;
}

.mg-token-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #f0f0f0;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.mg-token-link-btn:hover {
    background: #e0e0e0;
}

.mg-token-link-btn.copied {
    background: #4CAF50;
    color: #fff;
}

.mg-token-actions {
    display: flex;
    gap: 5px;
}

.mg-token-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.mg-token-action-btn:hover {
    background: #f0f0f0;
}

.mg-token-action-btn.delete:hover {
    background: #ffebee;
    color: #dc3545;
}

.mg-token-action-btn.email:hover {
    background: #e3f2fd;
    color: #2196f3;
}

/* Modal */
.mg-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mg-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.mg-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: mgModalIn 0.3s ease;
}

.mg-modal-small {
    max-width: 400px;
}

@keyframes mgModalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.mg-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
}

.mg-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.mg-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

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

.mg-modal-body {
    padding: 25px;
}

.mg-modal-body .mg-form-group {
    margin-bottom: 20px;
}

.mg-modal-body .mg-form-group:last-child {
    margin-bottom: 0;
}

.mg-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 25px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* Token URL display */
.mg-token-url-display {
    display: flex;
    gap: 10px;
}

.mg-token-url-display input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-family: monospace;
    background: #f8f9fa;
}

/* Responsive for stats */
@media (max-width: 600px) {
    .mg-access-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mg-stat-value {
        font-size: 24px;
    }
    
    .mg-tokens-table {
        font-size: 12px;
    }
    
    .mg-tokens-table th,
    .mg-tokens-table td {
        padding: 8px 6px;
    }
    
    .mg-modal-content {
        width: 95%;
        margin: 10px;
    }
}

/* ========================================
   BOUTONS FLOTTANTS (v2.5.6)
   ======================================== */
.mg-floating-buttons {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mg-float-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
}

.mg-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.mg-float-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mg-float-icon svg {
    width: 22px;
    height: 22px;
}

.mg-float-label {
    position: absolute;
    right: 60px;
    background: #333;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
}

.mg-float-label::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #333;
}

.mg-float-btn:hover .mg-float-label {
    opacity: 1;
    visibility: visible;
    right: 65px;
}

/* Toggle ON/OFF */
.mg-float-toggle {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: #fff;
}

.mg-float-toggle.is-on {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
}

.mg-float-toggle.is-off {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

/* Preview */
.mg-float-preview {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: #fff;
}

/* Save */
.mg-float-save {
    background: linear-gradient(135deg, #F97316 0%, #C2410C 100%);
    color: #fff;
}

.mg-float-save.saving {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    animation: mg-pulse 0.8s infinite;
}

.mg-float-save.saved {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
}

@keyframes mg-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Responsive floating buttons */
@media (max-width: 782px) {
    .mg-floating-buttons {
        right: 10px;
        bottom: 80px;
        top: auto;
        transform: none;
    }
    
    .mg-float-btn {
        width: 44px;
        height: 44px;
    }
    
    .mg-float-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .mg-float-label {
        display: none;
    }
}

/* ========================================
   CHAT IA - ASSISTANT (v2.6.5)
   ======================================== */

/* Bouton flottant Aide IA */
.mg-float-help {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%) !important;
}

.mg-float-help:hover {
    background: linear-gradient(135deg, #a66bbe 0%, #9b59b6 100%) !important;
    transform: translateY(-3px);
}

/* Modal Chat */
.mg-chat-modal {
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 99998;
    animation: mgChatSlideIn 0.3s ease;
}

@keyframes mgChatSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mg-chat-container {
    width: 380px;
    max-height: 500px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header du chat */
.mg-chat-header {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: #fff;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mg-chat-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    flex: 1;
}

.mg-chat-icon {
    font-size: 20px;
}

.mg-chat-status {
    font-size: 11px;
}

.mg-chat-pro-badge {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.mg-chat-free-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
}

.mg-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.mg-chat-close:hover {
    opacity: 1;
}

/* Zone des messages */
.mg-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    max-height: 300px;
    min-height: 200px;
}

.mg-chat-message {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    animation: mgMessageFadeIn 0.3s ease;
}

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

.mg-chat-message.mg-chat-user {
    flex-direction: row-reverse;
}

.mg-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.mg-chat-bot .mg-chat-avatar {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.mg-chat-user .mg-chat-avatar {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.mg-chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 14px;
}

.mg-chat-bot .mg-chat-bubble {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 16px 16px 16px 4px;
}

.mg-chat-user .mg-chat-bubble {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
    border-radius: 16px 16px 4px 16px;
}

.mg-chat-bubble ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.mg-chat-bubble li {
    margin-bottom: 5px;
}

/* Zone de saisie */
.mg-chat-input-wrapper {
    display: flex;
    padding: 15px;
    background: #fff;
    border-top: 1px solid #e9ecef;
    gap: 10px;
}

.mg-chat-input {
    flex: 1;
    border: 1px solid #e9ecef;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.mg-chat-input:focus {
    border-color: #9b59b6;
}

.mg-chat-input:disabled {
    background: #f8f9fa;
    cursor: not-allowed;
}

.mg-chat-send {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.mg-chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
}

.mg-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Footer */
.mg-chat-footer {
    padding: 10px 15px;
    background: #f8f9fa;
    text-align: center;
    color: #6c757d;
    font-size: 11px;
    border-top: 1px solid #e9ecef;
}

/* Message de chargement */
.mg-chat-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 16px 16px 16px 4px;
}

.mg-chat-typing span {
    width: 8px;
    height: 8px;
    background: #9b59b6;
    border-radius: 50%;
    animation: mgTypingDot 1s infinite;
}

.mg-chat-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.mg-chat-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes mgTypingDot {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Message limite atteinte */
.mg-chat-limit {
    text-align: center;
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    margin: 10px 0;
}

.mg-chat-limit a {
    color: #9b59b6;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 480px) {
    .mg-chat-modal {
        right: 10px;
        left: 10px;
        bottom: 80px;
    }
    
    .mg-chat-container {
        width: 100%;
    }
}

/* ========================================
   ONGLET AIDE & SYSTÈME (v2.6.9)
   ======================================== */

.mg-system-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

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

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

.mg-info-label {
    color: #666;
    font-size: 14px;
}

.mg-info-value {
    font-size: 14px;
    color: #333;
}

.mg-changelog {
    max-height: 300px;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.mg-changelog-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.mg-changelog-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.mg-changelog-item strong {
    color: #F97316;
    font-size: 15px;
}

.mg-changelog-date {
    color: #888;
    font-size: 13px;
}

.mg-changelog-item ul {
    margin: 8px 0 0 20px;
    padding: 0;
}

.mg-changelog-item li {
    font-size: 13px;
    color: #555;
    margin-bottom: 4px;
}

.mg-help-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.mg-help-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #F97316 0%, #C2410C 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mg-help-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    color: #fff;
}

.mg-help-icon {
    font-size: 18px;
}

.mg-update-check {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.mg-update-check p {
    margin-bottom: 15px;
}


/* ═══════════════════════════════════════════════════════════════
   v2.6.38 - Collapsible Sections (Accordion) - 1001Web Style
   Correction du layout et alignement
   ═══════════════════════════════════════════════════════════════ */
.mg-accordion {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    background: #fff;
    transition: all 0.3s ease;
    width: 100%;
    position: relative;
}

.mg-accordion:last-child {
    margin-bottom: 0;
}

.mg-accordion:hover,
.mg-accordion.is-open {
    border-color: #F97316;
    box-shadow: 0 4px 15px rgba(147, 83, 172, 0.15);
}
.mg-accordion-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f3f0ff 0%, #ebe4ff 100%);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}
.mg-accordion.is-open .mg-accordion-header {
    background: linear-gradient(135deg, #e8e0ff 0%, #ddd4ff 100%);
}
.mg-accordion-header:hover {
    background: linear-gradient(135deg, #e0d6ff 0%, #d4c8ff 100%);
}
.mg-accordion-arrow {
    font-size: 12px;
    margin-right: 12px;
    color: #F97316;
    transition: transform 0.3s ease;
    font-weight: bold;
}
.mg-accordion.is-open .mg-accordion-arrow {
    transform: rotate(90deg);
}
.mg-accordion-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0;
}
.mg-accordion-tooltip {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: #F97316;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 11px;
    margin-left: 8px;
    cursor: help;
    font-weight: bold;
}
.mg-accordion-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 10px;
}
.mg-accordion-badge.mg-badge-ok {
    background: #d4edda;
    color: #155724;
}
.mg-accordion-badge.mg-badge-default {
    background: #e9ecef;
    color: #6c757d;
}
.mg-accordion-badge.mg-badge-pro {
    background: linear-gradient(135deg, #f39c12, #e74c3c);
    color: #fff;
}
.mg-accordion-body {
    padding: 20px;
    border-top: 2px solid #e8e0ff;
    display: none;
    background: #fff;
}
.mg-accordion.is-open .mg-accordion-body {
    display: block;
    animation: mg-slideDown 0.3s ease;
}
@keyframes mg-slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* v2.6.30 - Video Presets Badge */
.mg-preset-video .mg-preset-preview {
    position: relative;
}
.mg-video-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 16px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}
.mg-preset-video:hover {
    border-color: #e74c3c;
}

/* ═══════════════════════════════════════════════════════════════
   v2.6.37 - Footer du plugin
   ═══════════════════════════════════════════════════════════════ */
.mg-footer {
    text-align: center;
    padding: 25px 20px;
    margin: 30px 20px 20px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.mg-footer p {
    margin: 0;
    color: #6c757d;
    font-size: 13px;
}

.mg-footer a {
    color: #F97316;
    text-decoration: none;
    font-weight: 600;
}

.mg-footer a:hover {
    color: #C2410C;
    text-decoration: underline;
}

/* ========================================
   EXPAND/COLLAPSE ALL BUTTONS (v2.6.48)
   ======================================== */
.mg-accordion-controls {
    display: flex;
    gap: 8px;
}

.mg-btn-sm {
    padding: 6px 12px !important;
    font-size: 12px !important;
    border-radius: 6px !important;
}

.mg-btn-expand-all,
.mg-btn-collapse-all {
    background: #f0f0f1 !important;
    color: #50575e !important;
    border: 1px solid #c3c4c7 !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mg-btn-expand-all:hover,
.mg-btn-collapse-all:hover {
    background: #F97316 !important;
    color: #fff !important;
    border-color: #F97316 !important;
}


/* ========================================
   MONITORING UPTIME (v2.8.0)
   ======================================== */

.mg-monitoring-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

#tab-monitoring .mg-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.mg-status-up {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mg-status-down {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    animation: mg-pulse-danger 2s infinite;
}

.mg-status-inactive {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

@keyframes mg-pulse-danger {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(220, 53, 69, 0); }
}

.mg-status-last-check {
    font-size: 12px;
    color: #6c757d;
}

.mg-monitoring-events-table-wrapper {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 6px;
}

.mg-event-down td:first-child {
    border-left: 3px solid #dc3545;
}

.mg-event-up td:first-child {
    border-left: 3px solid #28a745;
}

.mg-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.mg-badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.mg-badge-success {
    background: #d4edda;
    color: #155724;
}

.mg-inline-result {
    display: inline-block;
    margin-left: 10px;
    font-size: 13px;
}

.mg-empty-state {
    text-align: center;
    padding: 30px 20px;
    color: #6c757d;
    font-size: 14px;
}

.mg-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.mg-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.mg-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    min-width: 200px;
}

.mg-field-help {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

/* Radar icon animation (v2.8.4) */
.mg-radar-icon,
.mg-radar-icon-tab {
    color: #28a745;
}

.mg-radar-sweep {
    transform-origin: 12px 12px;
    animation: mg-radar-spin 3s linear infinite;
}

@keyframes mg-radar-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* PRO badge inline in header (v2.8.4) */
.mg-pro-badge-inline {
    display: inline-block;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
}

.mg-section-save.is-pending,
#mg-save-design.is-pending,
#mg-save-animations.is-pending,
#mg-float-save.is-pending {
    background: #fff7ed !important;
    color: #9a3412 !important;
    border: 1px solid #fed7aa !important;
}
.mg-section-save.is-saving,
#mg-save-design.is-saving,
#mg-save-animations.is-saving,
#mg-float-save.is-saving {
    background: #F97316 !important;
    color: #fff !important;
    cursor: wait;
    opacity: 0.85;
}
.mg-section-save.is-saved,
#mg-save-design.is-saved,
#mg-save-animations.is-saved,
#mg-float-save.is-saved {
    background: #f3f4f6 !important;
    color: #6b7280 !important;
    border: 1px solid #e5e7eb !important;
    transition: all 0.3s ease;
}
.mg-section-save.is-error,
#mg-save-design.is-error,
#mg-save-animations.is-error,
#mg-float-save.is-error {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca !important;
    animation: mgShake 0.4s;
}
@keyframes mgShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

#mg-float-save.is-pending { animation: mgPulseFab 1.4s infinite; }
#mg-float-save.is-saving { opacity: 0.9; }
#mg-float-save.is-saving .mg-float-icon { display: inline-flex; animation: mgSpinFab 1s linear infinite; }
#mg-float-save.is-saved { background: #16a34a !important; color: #fff !important; transition: background 0.3s; }
#mg-float-save.is-error { background: #dc2626 !important; color: #fff !important; animation: mgShake 0.4s; }

@keyframes mgPulseFab {
    0%, 100% { box-shadow: 0 0 0 0 rgba(249,115,22,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(249,115,22,0); }
}
@keyframes mgSpinFab {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================================================
 * v2.9.80 — Barre de recherche réglages + Arrière-plan unifié
 * ========================================================= */

/* ---- Barre de recherche réglages ---- */
.mg-settings-search {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 40px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}
.mg-settings-search .mg-search-icon {
    color: var(--mg-text-muted, #6b7280);
    flex-shrink: 0;
}
.mg-settings-search-input {
    flex: 1;
    max-width: 420px;
    height: 38px;
    padding: 0 14px;
    font-size: 14px;
    color: var(--mg-text, #1f2937);
    background: #fff;
    border: 1.5px solid var(--mg-border, #e5e7eb);
    border-radius: 10px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.mg-settings-search-input:focus {
    border-color: var(--mg-primary, #F97316);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, .15);
}
.mg-settings-search-clear {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: var(--mg-border, #e5e7eb);
    color: var(--mg-text, #1f2937);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}
.mg-settings-search-clear:hover { background: #d1d5db; }
.mg-search-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--mg-primary-dark, #C2410C);
}
/* En mode recherche, on masque la barre d'onglets (résultats transversaux) */
body.mg-searching .mg-tabs { opacity: .4; pointer-events: none; }
.mg-search-hit { animation: mg-search-pop .18s ease; }
@keyframes mg-search-pop {
    from { background: rgba(249, 115, 22, .10); }
    to   { background: transparent; }
}

/* ---- Arrière-plan unifié ---- */
.mg-bg-unified {
    border: 1.5px solid var(--mg-primary-light, #FED7AA);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(249,115,22,.04) 0%, rgba(249,115,22,0) 60%);
    padding: 16px;
    margin: 0 0 18px;
}
.mg-bg-unified-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}
.mg-bg-unified-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--mg-text, #1f2937);
}
.mg-bg-switch {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 4px;
}
.mg-bg-seg {
    border: none;
    background: transparent;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--mg-text-muted, #6b7280);
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
.mg-bg-seg:hover { color: var(--mg-primary-dark, #C2410C); }
.mg-bg-seg.is-active {
    background: var(--mg-primary, #F97316);
    color: #fff;
    box-shadow: 0 2px 6px rgba(249, 115, 22, .35);
}
.mg-bg-host .mg-bg-panel { margin-bottom: 10px; }
.mg-bg-host .mg-bg-panel:last-child { margin-bottom: 0; }

/* =========================================================
 * v2.9.82 — Bouton "Save background" + feedback FAB lisible
 *           (remplace le dirty-state redondant de v2.9.81 ;
 *            s'appuie sur l'autosave natif is-pending/is-saving/is-saved)
 * ========================================================= */

/* Bouton "Enregistrer l'arrière-plan" dans la barre du sélecteur */
.mg-bg-unified-head { justify-content: space-between; }
.mg-bg-save { margin-left: auto; white-space: nowrap; align-self: center; }

/* Étiquette d'état claire à gauche du FAB, pilotée par les classes natives.
   Le bouton ne tournant plus (seule l'icône tourne), l'étiquette reste stable. */
.mg-float-save { position: relative; }
.mg-float-save::before {
    position: absolute;
    right: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
    z-index: 5;
}
.mg-float-save.is-pending::before { content: attr(data-label-pending); background: #F97316; opacity: 1; }
.mg-float-save.is-saving::before  { content: attr(data-label-saving);  background: #6b7280; opacity: 1; }
.mg-float-save.is-saved::before   { content: attr(data-label-saved);   background: #16A34A; opacity: 1; }
.mg-float-save.is-error::before   { content: attr(data-label-error);   background: #EF4444; opacity: 1; }

/* Pendant un état, on masque le tooltip "Enregistrer" natif pour éviter la double bulle */
.mg-float-save.is-pending .mg-float-label,
.mg-float-save.is-saving .mg-float-label,
.mg-float-save.is-saved .mg-float-label,
.mg-float-save.is-error .mg-float-label { display: none !important; }

/* =========================================================
 * v2.9.101 — Tooltip FAB unifié (remplace les couches v2.6/v2.9.87).
 * Position FIXE à gauche du bouton au repos ET au survol → ne peut
 * jamais glisser/déborder sur le bouton. Apparition via opacity seule.
 * ========================================================= */
.mg-float-btn .mg-float-label {
    position: absolute;
    right: calc(100% + 12px);
    left: auto;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    margin: 0;
    padding: 6px 12px;
    background: #1f2937;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease;
    z-index: 7;
}
.mg-float-btn:hover .mg-float-label,
.mg-float-btn:focus-visible .mg-float-label {
    right: calc(100% + 12px) !important;
    opacity: 1 !important;
    visibility: visible !important;
    background: #1f2937 !important;
    color: #fff !important;
}
.mg-float-btn .mg-float-label {
    opacity: 0 !important;
    visibility: hidden !important;
    right: calc(100% + 12px) !important;
    left: auto !important;
}
.mg-float-btn:hover .mg-float-label,
.mg-float-btn:focus-visible .mg-float-label {
    opacity: 1 !important;
    visibility: visible !important;
}
.mg-float-btn .mg-float-label::after {
    content: '';
    position: absolute;
    right: -5px;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: #1f2937;
}

.mg-is-pro .mg-badge-pro,
.mg-is-pro .mg-pro-badge { display: none !important; }

/* =========================================================
 * v2.9.92 — U6 : titres de groupe (Identité / Mise en page / Effets)
 * Rythme visuel pour casser la monotonie des cartes empilées.
 * ========================================================= */
.mg-group-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 28px 4px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #9ca3af;
}
.mg-group-heading span { white-space: nowrap; }
.mg-group-heading::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, #e5e7eb 0%, transparent 100%);
}

/* =========================================================
 * v2.9.93 — U6/B : aplatir les panneaux dans le host
 * Fin du « cadre-dans-cadre » : le panneau de fond actif devient
 * du contenu de la carte Arrière-plan, sans second encadrement.
 * ========================================================= */
#mg-bg-host .mg-bg-panel {
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    margin: 0;
}
#mg-bg-host .mg-bg-panel:hover,
#mg-bg-host .mg-bg-panel.is-open {
    border-color: transparent;
    box-shadow: none;
}
#mg-bg-host .mg-bg-panel > .mg-accordion-header,
#mg-bg-host .mg-bg-panel.is-open > .mg-accordion-header,
#mg-bg-host .mg-bg-panel > .mg-accordion-header:hover {
    background: transparent;
    padding: 4px 2px 10px;
}
#mg-bg-host .mg-bg-panel > .mg-accordion-body {
    border-top: none;
    background: transparent;
    padding: 4px 2px 2px;
}

/* =========================================================
 * v2.9.95 — Arrière-plan pliable comme les autres accordéons
 * ========================================================= */
.mg-bg-toggle {
    display: flex;
    align-items: center;
    gap: 0;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}
.mg-bg-toggle .mg-accordion-arrow {
    transform: rotate(0deg);
}
.mg-bg-unified.is-open .mg-bg-toggle .mg-accordion-arrow {
    transform: rotate(90deg);
}
.mg-bg-unified:not(.is-open) #mg-bg-host {
    display: none;
}

/* =========================================================
 * v2.9.97 — Arrière-plan : même style que les autres accordéons
 * (bordure grise + bandeau violet) + chevron unique.
 * ========================================================= */
.mg-bg-unified {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    padding: 0;
    overflow: hidden;
    box-shadow: none;
}
.mg-bg-unified:hover,
.mg-bg-unified.is-open {
    border-color: #F97316;
    box-shadow: 0 4px 15px rgba(147, 83, 172, 0.15);
}
.mg-bg-unified-head {
    background: linear-gradient(135deg, #f3f0ff 0%, #ebe4ff 100%);
    padding: 16px 20px;
    margin-bottom: 0;
}
.mg-bg-unified.is-open .mg-bg-unified-head {
    background: linear-gradient(135deg, #e8e0ff 0%, #ddd4ff 100%);
}
#mg-bg-host {
    padding: 20px;
    border-top: 2px solid #e8e0ff;
    background: #fff;
}

/* Chevron unique : le bloc Arrière-plan gère le pliage ; le panneau interne
 * (Image/Dégradé/…) n'a plus de chevron ni de pliage propre. */
#mg-bg-host .mg-bg-panel > .mg-accordion-header .mg-accordion-arrow {
    display: none;
}
#mg-bg-host .mg-bg-panel > .mg-accordion-header {
    cursor: default;
}
#mg-bg-host .mg-bg-panel > .mg-accordion-body {
    display: block !important;
}

/* =========================================================
 * v2.9.103 — Mode Simple / Expert
 * ========================================================= */
.mg-tabs { flex-wrap: wrap; align-items: center; }
.mg-mode-switch {
    margin-left: auto;
    display: inline-flex;
    gap: 2px;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 3px;
    align-self: center;
}
.mg-mode-seg {
    border: none;
    background: transparent;
    padding: 5px 16px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.mg-mode-seg.is-active {
    background: #fff;
    color: #F97316;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}
.mg-mode-hint {
    display: none;
    max-width: 1400px;
    margin: 16px auto 0;
    padding: 9px 16px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    font-size: 13px;
    color: #9a3412;
}
.mg-mode-simple .mg-mode-hint { display: block; }
.mg-mode-hint-link {
    border: none;
    background: none;
    color: #F97316;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    margin-left: 4px;
}
.mg-mode-simple [data-mg-level="advanced"] { display: none !important; }

.mg-float-label { display: none !important; }

/* ============================================================
   DIAGNOSTIC (v2.9.116)
   ============================================================ */

/* Pastille onglet (pattern WP natif) */
.mg-diag-pill {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 5px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    color: #fff;
    vertical-align: middle;
}
.mg-diag-pill-fail { background: #d63638; }
.mg-diag-pill-warn { background: #f0a000; }

/* Badges contextuels de section */
.mg-diag-badge {
    display: inline-block;
    margin-left: 6px;
    font-size: 13px;
    cursor: pointer;
    line-height: 1;
    vertical-align: middle;
}
.mg-diag-badge-never { opacity: 0.45; }
.mg-diag-badge-never:hover { opacity: 1; }
.mg-diag-badge-fail { animation: mgDiagPulse 2s ease-in-out infinite; }
@keyframes mgDiagPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Bandeau critique */
.mg-diag-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    padding: 12px 16px;
    background: #fcf0f1;
    border: 1px solid #d63638;
    border-left-width: 4px;
    border-radius: 6px;
}
.mg-diag-banner-icon { font-size: 18px; }
.mg-diag-banner-text { flex: 1; font-weight: 600; color: #3c1618; }
.mg-diag-banner-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #d63638;
    padding: 2px 6px;
}
.mg-diag-banner-close:hover { color: #a02224; }

/* Onglet — intro + actions */
.mg-diag-intro { color: #555; max-width: 720px; }
.mg-diag-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 16px 0;
}
.mg-diag-last { font-size: 12px; color: #888; }

/* Items résultat */
.mg-diag-results { margin-top: 8px; }
.mg-diag-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid #e2e4e7;
    border-left-width: 4px;
    border-radius: 6px;
    transition: box-shadow 0.2s;
}
.mg-diag-item.mg-diag-highlight { box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.4); }
.mg-diag-ok   { border-left-color: #16A34A; }
.mg-diag-warn { border-left-color: #f0a000; }
.mg-diag-fail { border-left-color: #d63638; }
.mg-diag-skip { border-left-color: #c3c4c7; opacity: 0.75; }

.mg-diag-status { font-size: 16px; line-height: 1.4; }
.mg-diag-ok   .mg-diag-status::before { content: '✅'; }
.mg-diag-warn .mg-diag-status::before { content: '⚠️'; }
.mg-diag-fail .mg-diag-status::before { content: '❌'; }
.mg-diag-skip .mg-diag-status::before { content: '➖'; }

.mg-diag-body { flex: 1; }
.mg-diag-label { display: block; font-size: 14px; margin-bottom: 3px; }
.mg-diag-detail { margin: 0 0 4px; color: #555; font-size: 13px; }
.mg-diag-fix {
    margin: 6px 0 0;
    padding: 8px 10px;
    background: #fff8e5;
    border-radius: 4px;
    font-size: 13px;
    color: #6b4e00;
}

/* Test courriel */
.mg-diag-email-test {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #e2e4e7;
}
.mg-diag-email-test h3 { margin: 0 0 10px; font-size: 14px; }
.mg-diag-email-row { display: flex; gap: 10px; max-width: 480px; }
.mg-diag-email-row input[type="email"] { flex: 1; }
.mg-diag-email-result { margin-top: 8px; font-size: 13px; }
.mg-diag-email-ok  { color: #16A34A; font-weight: 600; }
.mg-diag-email-err { color: #d63638; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════
   THÈMES COMPLETS v2.9.118
   ═══════════════════════════════════════════════════════════ */
.mg-themes-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e4e7;
}

.mg-themes-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.mg-themes-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e1e1e;
}

/* Bouton Annuler à droite */
.mg-themes-header #mg-revert-theme {
    margin-left: auto;
}

/* Grille 4 colonnes responsive */
.mg-themes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 900px) {
    .mg-themes-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .mg-themes-grid { grid-template-columns: 1fr 1fr; }
}

/* Carte thème */
.mg-theme-card {
    all: unset;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border-radius: 10px;
    border: 2px solid transparent;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    overflow: hidden;
    transition: border-color .18s, box-shadow .18s, transform .12s;
    text-align: left;
}

.mg-theme-card:hover {
    border-color: #c7c7c7;
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
    transform: translateY(-2px);
}

.mg-theme-card:focus-visible {
    outline: 3px solid #F97316;
    outline-offset: 2px;
}

.mg-theme-card.is-active {
    border-color: #F97316;
    box-shadow: 0 0 0 3px rgba(249,115,22,.18);
}

/* Mini aperçu gradient */
.mg-theme-preview {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    position: relative;
}

.mg-theme-aa {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.mg-theme-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    opacity: .9;
}

/* Infos sous le preview */
.mg-theme-info {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.mg-theme-label {
    font-size: 13px;
    font-weight: 700;
    color: #1e1e1e;
    line-height: 1.2;
}

.mg-theme-active-badge {
    display: inline-block;
    background: #F97316;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 20px;
    letter-spacing: .4px;
    width: fit-content;
}

.mg-theme-desc {
    font-size: 11px;
    color: #767676;
    line-height: 1.35;
}

.mg-mode-selector {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e9ecef;
}
.mg-mode-selector-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.mg-mode-selector-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.mg-mode-option {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    background: #fff;
    position: relative;
}
.mg-mode-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.mg-mode-option:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}
.mg-mode-option.is-active {
    border-color: #F97316;
    background: #fff7ed;
}
.mg-mode-option.is-active .mg-mode-option-title {
    color: #ea580c;
}
.mg-mode-option-icon {
    font-size: 20px;
    line-height: 1;
    margin-bottom: 2px;
}
.mg-mode-option-title {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
}
.mg-mode-option-desc {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.4;
}
@media (max-width: 600px) {
    .mg-mode-selector-options { grid-template-columns: 1fr; }
}

.mg-status-badge.active.coming-soon {
    background: linear-gradient(135deg, #16A34A 0%, #15803D 100%);
    box-shadow: 0 0 20px rgba(22, 163, 74, 0.6),
                0 0 40px rgba(22, 163, 74, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: mg-pulse-glow-cs 2s ease-in-out infinite;
}
@keyframes mg-pulse-glow-cs {
    0%, 100% { box-shadow: 0 0 20px rgba(22,163,74,.6), 0 0 40px rgba(22,163,74,.3), inset 0 1px 0 rgba(255,255,255,.3); }
    50%       { box-shadow: 0 0 30px rgba(22,163,74,.8), 0 0 60px rgba(22,163,74,.4), inset 0 1px 0 rgba(255,255,255,.3); }
}


.mg-version-update {
    background: #fff !important;
    color: #F97316 !important;
    font-weight: 700;
    cursor: pointer;
    animation: mg-update-pulse 2s ease-in-out infinite;
    border: 2px solid #fff;
}
@keyframes mg-update-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55); }
    50%      { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .mg-version-update { animation: none; box-shadow: 0 0 0 2px rgba(255,255,255,0.55); }
}
#mg-update-panel {
    position: absolute;
    top: 64px;
    left: 24px;
    z-index: 100000;
    width: 420px;
    max-width: calc(100vw - 48px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    padding: 18px 20px;
    color: #1d2327;
    text-align: left;
}
#mg-update-panel .mg-update-panel-head { font-size: 15px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
#mg-update-panel .mg-update-date { font-size: 12px; color: #646970; margin-left: auto; }
#mg-update-panel .mg-update-changelog {
    font-size: 13px; line-height: 1.55; color: #3c434a;
    max-height: 220px; overflow-y: auto;
    background: #f6f7f7; border-radius: 8px; padding: 12px 14px; margin-bottom: 14px;
}
#mg-update-panel .mg-update-panel-actions { display: flex; gap: 10px; align-items: center; }
#mg-update-panel .mg-btn-update-download {
    background: linear-gradient(135deg, #F97316, #FB923C); color: #fff !important;
    padding: 9px 16px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 13px;
}
#mg-update-panel .mg-btn-update-later {
    background: none; border: 1px solid #dcdcde; border-radius: 8px;
    padding: 8px 14px; color: #646970; cursor: pointer; font-size: 13px;
}
.mg-header-left { position: relative; }
