/* =============================================================
   CSS Front — Module Equipe (grille + gestion + organigramme)
   ============================================================= */

/* --- Filtres --- */
.equipe-filtres {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.equipe-filtres input,
.equipe-filtres select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

/* --- Grille cartes --- */
.grille-equipe {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2%;
}

/* --- Carte equipe --- */
.carte-equipe {
    border: 1px solid #ddd;
    border-radius: 5vw 0 0 0;
    max-width: 320px;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: left;
    overflow: hidden;
    height: fit-content;
}

.carte-image {
    width: 100%;
    height: 270px;
    background-size: cover;
    background-position: center;
    border-radius: 0px;
    background-color: white;
}

.pros-content {
    padding: 4%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.pros-content h3 {
    font-size: 19px !important;
}

.pros-content p {
    padding-bottom: 5px !important;
    font-size: 15px !important;
}

.communes-block {
    background-color: #4d74b5;
    color: white !important;
    padding: 2%;
    font-size: 15px !important;
}

/* --- Header (toujours visible) --- */
.pros-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.pros-info-base {
    flex: 1;
}

.pros-info-base .profession {
    margin: 5px 0 0;
    color: #666;
}

/* --- Bouton toggle --- */
.toggle-details {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: background 0.2s;
}

.toggle-details:hover {
    background: rgba(0, 0, 0, 0.05);
}

.toggle-icon {
    display: block;
    width: 12px;
    height: 12px;
    border-right: 2px solid #333;
    border-bottom: 2px solid #333;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    margin-top: -4px;
}

.toggle-details[aria-expanded="true"] .toggle-icon {
    transform: rotate(-135deg);
    margin-top: 4px;
}

/* --- Details (caches par defaut) --- */
.pros-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding-top: 0;
}

.pros-details.open {
    max-height: 300px;
    padding-top: 15px;
}

.pros-details p {
    margin: 5px 0;
}

/* =====================================================
   FORMULAIRE GESTION EQUIPE
   ===================================================== */
.hidden-form {
    display: none !important;
}

/* Bouton flottant */
.btn-gestion-equipe {
    position: fixed;
    bottom: 80px;
    left: 20px;
    background: #fff!important;
    color: #4d74b5!important;
    border: none;
    border-radius: 50%;
    font-size: 22px;
    width: 55px;
    height: 55px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 999;
}

.btn-gestion-equipe img {
    width: 24px;
    height: 24px;
}

/* Popup laterale gestion equipe */
.popup-gestion-equipe {
    position: fixed;
    bottom: 0;
    right: -800px;
    width: 800px;
    max-width: 800px;
    border-radius: 30px 0 0 0;
    height: 91vh;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: right 0.3s ease;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.popup-gestion-equipe.open {
    right: 0;
}

/* Header du drawer equipe */
.popup-header-edit {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: #4d74b5;
    color: white;
    border-bottom: 1px solid #3d5a8f;
    flex-shrink: 0;
}

.popup-header-edit h4 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    padding: 0 !important;
    color: white !important;
    font-family: 'Nexa Light';
}

.popup-header-edit button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    color: white;
}

.popup-header-edit button img {
    width: 30px;
    height: 30px;
}

/* Contenu drawer equipe */
.popup-content-edit {
    padding: 6%;
    flex: 1;
    overflow-y: auto;
}

/* Liste des professionnels */
.ligne-equipe {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding: 10px 0;
}

.titre-equipe {
    flex: 1;
    font-family: 'Nexa light';
    font-weight: 600;
}

.btn-edit,
.btn-delete {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin-left: 5px;
}

.btn-edit img,
.btn-delete img {
    width: 20px;
    height: 20px;
}

.compteur-equipe {
    margin-top: 15px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 6px;
    text-align: center;
}

/* Formulaire equipe */
.form-equipe {
    margin-top: 15px;
    position: relative;
}

.form-equipe label {
    display: block;
    margin: 10px 0 5px;
    font-weight: 500;
}

.form-equipe input[type="text"],
.form-equipe input[type="email"],
.form-equipe input[type="number"],
.form-equipe input[type="file"] {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}

.form-equipe input[type="date"] {
    border: 1px solid #b3b3b3;
    border-radius: 5px;
    padding: 8px 5px;
}

.form-equipe input[type="time"] {
    border: 1px solid #b3b3b3;
    border-radius: 5px;
    padding: 7px 5px;
}

.form-equipe input[type="url"] {
    border: 1px solid #b3b3b3;
    border-radius: 5px;
    padding: 10px 5px;
}

.form-equipe select {
    border: 1px solid #b3b3b3;
    border-radius: 5px;
    padding: 8px 5px !important;
}

.form-equipe fieldset {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    margin-top: 15px;
}

.form-equipe legend {
    padding: 0 5px;
    font-weight: 500;
}

.liste-communes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 5px;
}

.liste-communes label {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: normal;
}

.liste-communes input[type="checkbox"] {
    margin-right: 5px;
    width: auto;
}

/* Actions du formulaire */
.form-actions {
    display: flex;
    justify-content: space-around;
    gap: 10px;
    padding: 10px 0;
    margin-top: 20px;
    position: sticky;
    background-color: white;
    bottom: 0;
    width: 100%;
}

.btn-save,
.btn-cancel {
    flex: 1;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
}

.btn-save {
    background: #c9ddd8ba;
    border: 1px solid #33ae8f;
}

.btn-save:hover {
    background: #fff;
}

.btn-cancel {
    background: #edb0b0a3;
    border: 1px solid #e82828;
}

.btn-cancel:hover {
    background: #fff;
}

.btn-save img,
.btn-cancel img {
    width: 20px;
    height: 20px;
}

/* Footer drawer */
.popup-footer {
    padding: 20px 30px;
    background: #f5f5f5;
    border-top: 1px solid #ddd;
    text-align: center;
    flex-shrink: 0;
}

.btn-add {
    background: #4d74b557;
    color: #fff;
    border: none;
    padding: 6px 20px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    border: 2px solid #4d74b5;
    box-shadow: 0px 0px 10px #b6b6b6;
    transition: background 0.3s ease;
}

.btn-add:hover {
    background: #fff;
}

.btn-add img {
    width: 35px;
    height: auto;
}

/* Preview image */
.image-preview-container {
    margin: 10px 0;
    text-align: center;
}

.image-preview {
    max-width: 100%;
    max-height: 200px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

.image-preview.hidden {
    display: none;
}

/* Badge event */
.event-badge {
    display: inline-block;
    padding: 0px 10px;
    border-radius: 12px 0 0 0;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
    color: #fff;
    vertical-align: middle;
}

.badge-past {
    background-color: #d0ad75;
}

.badge-future {
    background-color: #00a19b;
}

.projets-drawer-trigger.btn-gestion-equipe {
    background: white !important;
}

/* =====================================================
   ORGANIGRAMME DRAWER
   ===================================================== */
#open-organigramme-drawer {
    background: #fff;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 22px;
    width: 55px;
    height: 55px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#open-organigramme-drawer img {
    width: 24px;
    height: 24px;
}

/* Overlay organigramme */
#organigramme-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
    z-index: 9998;
}

#organigramme-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Drawer organigramme */
#organigramme-drawer {
    position: fixed;
    top: 76px;
    right: -100%;
    width: 90%;
    max-width: 1200px;
    height: 92vh;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, .2);
    z-index: 9999;
    transition: right .4s ease;
    display: flex;
    flex-direction: column;
    border-radius: 25px 0 0 0;
}

#organigramme-drawer.open {
    right: 0;
}

#drawer-header {
    background: #00A19B;
    color: #fff;
    padding: 12px 18px 12px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 25px 0 0 0;
}

#drawer-header h3 {
    margin: 0;
    font-size: 18px;
    padding: 0;
    color: white !important;
}

#close-organigramme-drawer {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

#drawer-iframe {
    border: none;
    flex: 1;
    width: 100%;
    height: calc(100vh - 50px);
    padding: 1%;
}

/* Toast organigramme */
#org-toast {
    position: fixed;
    top: 16px;
    right: 16px;
    background: #1f2937;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity .2s ease, transform .2s ease;
    z-index: 10000;
    pointer-events: none;
    font-size: 14px;
}

#org-toast.show {
    opacity: 1;
    transform: translateY(0);
}

#drawer-iframe .wp-core-ui .button-secondary {
    color: white !important;
}

/* =====================================================
   ORGANIGRAMME CHART (wpdevart)
   ===================================================== */
.wpdevart_org_chart_container .wpda_tree_item_img_cont {
    width: 130px !important;
}

div.wpdevart_org_chart .wpdevart_org_chart_container li .wpda_tree_item_container > div {
    display: flex;
    padding: 15px !important;
    border-radius: 30px 0 0 0;
    min-height: 252px;
    width: 100%;
    min-width: 192px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

div.wpda_tree_item_title {
    font-family: 'Nexa Light';
    font-weight: bold !important;
    color: #4d74b5;
    max-width: 160px;
    word-break: break-word;
    text-align: center;
    margin: 0 auto;
}

#wpdevart_org_chart_container_2 > ul > li > ul > li:nth-child(1) > ul div.wpda_tree_item_desc {
    background-color: #00a19b;
    color: white;
    min-height: 14vh;
    font-family: 'Nexa Light';
    margin: 5px 0 0 0;
    line-height: 1.2rem;
    padding: 10px 5px;
}

#wpdevart_org_chart_container_2 > ul > li > ul > li > ul li .wpda_tree_item_container > div {
    min-width: 11vw;
    padding: 15px 0 0 0 !important;
    background: white !important;
}

.wpda_tree_item_container > div {
    background: white !important;
}

#wpdevart_org_chart_container_2 > ul > li > ul > li:nth-child(2) > ul div.wpda_tree_item_desc {
    background-color: #1d66af;
    margin: 5px 0 0 0;
    color: white;
    font-family: 'Nexa Light';
    min-height: 14vh;
    line-height: 1.2rem;
    padding: 10px 5px;
}

#wpdevart_org_chart_container_2 {
    background: transparent !important;
}

div.wpda_tree_item_desc {
    font-family: 'Nexa Light';
}

#wpdevart_org_chart_container_1 {
    background-image: none !important;
}

#wpda_item_container_1 > div > div.wpda_tree_item_img_cont {
    width: 30vw !important;
    height: auto !important;
}

#wpda_item_container_1 > div > div.wpda_tree_item_img_cont > img {
    width: 30vw !important;
}

/* Onglets organigramme drawer */
.drawer-tabs {
    display: flex;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.drawer-tab {
    flex: 1;
    padding: 15px 20px;
    background: #f5f5f5;
    border: none;
    border-right: 1px solid #ddd;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.drawer-tab:last-child {
    border-right: none;
}

.drawer-tab:hover {
    background: #e8e8e8;
}

.drawer-tab.active {
    background: #fff;
    color: #4d74b5;
    border-bottom: 2px solid #4d74b5;
}

#tab-organigramme {
    height: calc(100% - 120px);
    padding: 0;
}

/* Contenu des onglets drawer */
.drawer-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.drawer-tab-content.active {
    display: block;
}

/* Form group (drawer organigramme / CPTS) */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    padding: 1%;
    border: 1px solid #ececec;
    border-radius: 10px;
    background-color: #4d74b557;
}

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

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

.form-group textarea:focus {
    outline: none;
    border-color: #4d74b5;
    box-shadow: 0 0 0 2px rgba(77, 116, 181, 0.1);
}

/* Upload image (drawer) */
.image-upload-wrapper {
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    margin-top: 8px;
}

.button-secondary {
    background: #4d74b5;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.button-secondary:hover {
    background: #3d5a8f;
}

.image-preview {
    margin-top: 15px;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
    border: 2px solid #e5e5e5;
    border-radius: 4px;
    background: #f9f9f9;
}

.image-preview img {
    display: block;
    max-width: 300px;
    max-height: 200px;
    border-radius: 2px;
}

.remove-image {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #eb6369;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.remove-image:hover {
    background: #d43f45;
}

/* Bouton primaire (drawer) */
.button-primary {
    background: #4d74b5;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.button-primary:hover {
    background: #3d5a8f;
}

/* Intro forms (liens, events, projets) */
#form-intro-liens > div.d-flex > div:nth-child(1),
#form-intro-events > div.d-flex > div:nth-child(1),
#form-intro-projets > div.d-flex > div:nth-child(1) {
    min-width: 65%;
}

/* =====================================================
   RESPONSIVE EQUIPE
   ===================================================== */
@media screen and (max-width: 767px) {
    .carte-equipe {
        max-width: 100% !important;
    }

    .grille-equipe {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(40%, 1fr));
        gap: 2%;
    }

    .carte-image {
        width: 100%;
        height: 170px;
    }

    /* Organigramme mobile */
    #wpdevart_org_chart_container_2,
    .wpda_mobile.wpdevart_org_chart_container ul,
    .wpdevart_org_chart_container .chart_wpda_mobile_after ul,
    .wpdevart_org_chart_container_parent .wpdevart_org_chart_container ul {
        width: 100%;
    }

    .wpda_mobile.wpdevart_org_chart_container ul,
    .wpdevart_org_chart_container .chart_wpda_mobile_after ul {
        padding-left: 0 !important;
    }

    .wpda_mobile.wpdevart_org_chart_container li .wpda_tree_item_container,
    .wpdevart_org_chart_container .chart_wpda_mobile_after .wpda_tree_item_container {
        width: 100% !important;
        padding: 1% !important;
        margin: 2vh 0 !important;
    }

    .wpda_tree_line,
    .wpda_mobile.wpdevart_org_chart_container li.has_children > .wpda_tree_item_container:before,
    .wpdevart_org_chart_container .chart_wpda_mobile_after.has_children > .wpda_tree_item_container:before,
    .wpdevart_org_chart_container .chart_wpda_mobile_after li.has_children > .wpda_tree_item_container:before,
    .wpda_mobile#wpdevart_org_chart_container_2 li.has_children > .wpda_tree_item_container:before {
        display: none !important;
    }

    div.wpdevart_org_chart .wpdevart_org_chart_container li .wpda_tree_item_container > div {
        width: 85%;
        min-width: 80vw;
    }

    div.wpda_tree_item_title {
        font-size: 1.5rem;
        word-break: auto-phrase;
    }

    div.wpda_tree_item_desc {
        font-size: 1rem;
    }

    #wpda_item_container_1 > div > div.wpda_tree_item_img_cont {
        width: 72vw !important;
    }

    .wpdevart_org_chart_container .wpda_tree_item_img_cont {
        margin-top: 20px !important;
    }

    #wpda_item_container_1 > div > div.wpda_tree_item_img_cont > img {
        width: 100% !important;
    }

    .wpda_mobile#wpdevart_org_chart_container_1 > ul > li > ul li,
    .wpda_mobile#wpdevart_org_chart_container_1 li.has_children li .wpda_tree_item_container:after {
        border: none !important;
    }
}

/* =====================================================
   Extracted from equipe.php [gestion_equipe] inline styles
   ===================================================== */
.hidden-form {
    display: none !important;
}
.ge-inline {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}
.ge-mini-btn {
    padding: 6px 10px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    background: #e1e5ea;
}
.ge-mini-btn:hover {
    background: #d0d4da;
}
.ge-add-profession {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.ge-add-profession input[type="text"] {
    flex: 1;
}
/* Style pour le conteneur TinyMCE */
.tox-tinymce {
    border-radius: 4px !important;
}
#texte_intro {
    width: 100%;
    min-height: 200px;
}

/* =====================================================
   Extracted from equipe.php [edit_organigramme_drawer] inline styles
   ===================================================== */
/* Drawer principal */
#organigramme-drawer {
    position: fixed;
    top: 9vh;
    right: -900px;
    width: 100%;
    max-width: 900px;
    height: 92vh;
    background: #fff;
    z-index: 9999998;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    border-radius: 30px 0 0 0;
    box-shadow: -2px 0 20px rgba(0,0,0,0.25);
}
#organigramme-drawer.open {
    right: 0;
}
#organigramme-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 9999997;
    display: none;
}
#organigramme-overlay.open {
    display: block;
}

/* Header drawer */
#drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #ddd;
    background: #4d74b5;
}
#drawer-header h3 {
    margin: 0;
    padding: 0 !important;
    font-size: 20px !important;
    color: white !important;
    font-weight: 600 !important;
    font-family: 'Nexa Light' !important;
}
#close-organigramme-drawer {
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: white !important;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
#close-organigramme-drawer:hover {
    background: white;
    color: #4d74b5 !important;
}

/* Onglets */
.drawer-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    background: #f9f9f9;
}
.drawer-tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    font-family: "Nexa Light" !important;
    color: #686868 !important;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}
.drawer-tab:hover {
    background: #e9eef0;
}
.drawer-tab.active {
    color: #4d74b5 !important;
    border-bottom-color: #4d74b5;
}
.drawer-tab-content {
    display: none;
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}
.drawer-tab-content.active {
    display: block;
}

/* Formulaire */
.drawer-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.d-flex {
    display: flex;
    gap: 16px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-radius: 10px;
    background-color: #4d74b557;
    padding: 15px;
}
.form-group.half-flex {
    flex: 1;
}
.form-group label {
    font-weight: 600;
    font-size: 14px;
    color: #1d2327;
    font-family: 'Nexa Light';
}
.form-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    width: 100%;
    min-height: 150px;
}
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}
.button-primary {
    background: #00a09a;
    color: white;
    padding: 10px 20px;
    min-width: 30%;
    border: none;
    border-radius: 6px;
    font-family: 'Nexa Light';
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}
.button-primary:hover {
    background: #5a6268;
}
.button-secondary {
    min-width: 30%;
    background: #4d74b5;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-family: 'Nexa Light';
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}
.button-secondary:hover {
    background: #5a6268;
}

/* Upload image */
.image-upload-wrapper {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
}
.image-preview {
    position: relative;
    max-width: 300px;
}
.image-preview img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #ddd;
}
.image-preview .remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #dc3545;
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-preview .remove-image:hover {
    background: #c82333;
}

/* Iframe */
#tab-organigramme iframe {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border: none;
}

/* Toast */
#org-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 6px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 99999999;
}
#org-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* TinyMCE dans le drawer */
#orga_texte_intro,
#orga_texte_organigramme {
    width: 100%;
    min-height: 150px;
}
.tox-tinymce,
.mce-tinymce {
    border-radius: 6px !important;
}

/* IMPORTANT: Z-index pour les menus TinyMCE */
.mce-menu,
.mce-floatpanel,
.mce-panel.mce-floatpanel,
.mce-container.mce-panel.mce-floatpanel,
.mce-container.mce-panel.mce-floatpanel.mce-menu,
body > .mce-menu,
body > .mce-floatpanel {
    z-index: 99999999999 !important;
}
.mce-menu .mce-menu-item,
.mce-menu-item {
    display: block !important;
}
.mce-listbox .mce-menu {
    max-height: 300px !important;
    overflow-y: auto !important;
    background: #fff !important;
}

/* Media Library au-dessus */
.media-modal {
    z-index: 9999999999999 !important;
}
.media-modal-backdrop {
    z-index: 99999 !important;
}

@media (max-width: 768px) {
    .d-flex {
        flex-direction: column;
    }
    #organigramme-drawer {
        max-width: 100%;
    }
}
