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

body {
    font-family: Arial, sans-serif;
    overflow: hidden;
}

#canvas3d {
    width: 100vw;
    height: 100vh;
    display: block;
}

/* Bouton toggle (quand le panneau est réduit) */
.toggle-panneau {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1001;
    transition: all 0.3s ease;
}

.toggle-panneau:hover {
    background: #45a049;
    transform: scale(1.1);
}

.toggle-panneau.visible {
    display: block;
}

/* Interface principale */
#interface {
    position: fixed;
    top: 20px;
    left: 20px;
    background: white;
    padding: 0;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    width: 380px;
    max-height: 90vh;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1000;
}

#interface.interface-reduite {
    transform: translateX(-410px);
}

/* En-tête */
.interface-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #4CAF50 0%, #2196F3 100%);
    border-radius: 10px 10px 0 0;
    color: white;
}

.interface-header h2 {
    font-size: 18px;
    margin: 0;
}

.btn-reduire {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-reduire:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

/* Sections déroulantes */
.section-deroulante {
    border-bottom: 1px solid #e0e0e0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.section-header:hover {
    background: #f5f5f5;
}

.section-titre {
    font-weight: bold;
    font-size: 15px;
    color: #333;
}

.section-fleche {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s ease;
}

.section-fleche.rotate {
    transform: rotate(-90deg);
}

.section-contenu {
    padding: 0 20px 0 20px;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.section-contenu.ferme {
    max-height: 0;
    padding: 0 20px;
    overflow: hidden;
}

.section-vide {
    color: #999;
    font-style: italic;
    font-size: 13px;
    text-align: center;
    padding: 20px 0;
}

/* Sous-sections déroulantes */
.sous-section-deroulante {
    margin-top: 10px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
}

.sous-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    border-radius: 6px;
}

.sous-section-header:hover {
    background: #f0f0f0;
}

.sous-section-titre {
    font-weight: bold;
    font-size: 14px;
    color: #555;
}

.sous-section-fleche {
    font-size: 11px;
    color: #888;
    transition: transform 0.3s ease;
}

.sous-section-fleche.rotate {
    transform: rotate(-90deg);
}

.sous-section-contenu {
    padding: 0 15px 15px 15px;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.sous-section-contenu.ferme {
    max-height: 0;
    padding: 0 15px;
    overflow: hidden;
}

/* Bouton principal */
.btn-principal {
    width: 75%;
    margin: 0 auto;
    display: block;
    padding: 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-principal:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Bouton Extraction Plan 2D */
.btn-extraction-2d {
    width: 75%;
    margin: 0 auto;
    display: block;
    padding: 12px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-extraction-2d:hover {
    background: linear-gradient(135deg, #2980b9, #1f6dad);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

/* Conteneur du bouton Tout réinitialiser (sticky en bas) */
.btn-reinitialiser-container {
    position: sticky;
    bottom: 0;
    padding: 15px 0;
    background: white;
    border-top: 1px solid #e0e0e0;
    margin-top: 10px;
}

/* Bouton Tout réinitialiser */
.btn-reinitialiser {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #4CAF50 0%, #2196F3 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s;
}

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

/* Section couches */
.section-couches {
    margin-top: 10px;
}

.couche-block {
    margin-bottom: 12px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.couche-titre {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 8px;
    color: #333;
}

.couche-actions {
    display: flex;
    gap: 6px;
}

.btn-couche-action {
    flex: 1;
    padding: 8px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.btn-couche-action:hover {
    background: #0b7dda;
    transform: translateY(-1px);
}

.btn-couche-action.secondary {
    background: #607D8B;
}

.btn-couche-action.secondary:hover {
    background: #455A64;
}

.btn-couche-action.active {
    background: #4CAF50;
}

.btn-couche-action.active:hover {
    background: #45a049;
}

.btn-couche-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-couche-all {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background: #78909C;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-couche-all:hover {
    background: #607D8B;
    transform: translateY(-1px);
}

/* Zone d'informations */
#infos {
    margin: 15px 20px 20px 20px;
    padding: 12px;
    background: #E8F5E9;
    border-left: 4px solid #4CAF50;
    border-radius: 4px;
    font-size: 13px;
    color: #2E7D32;
}

/* Scrollbar personnalisée */
#interface::-webkit-scrollbar {
    width: 8px;
}

#interface::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#interface::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

#interface::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ==================== */
/* CORPS INDIVIDUELS    */
/* ==================== */

.corps-recherche {
    margin-bottom: 12px;
}

.corps-recherche input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.corps-recherche input:focus {
    border-color: #4CAF50;
}

.liste-corps {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.corps-item {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}

.corps-item:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.corps-item.hidden {
    opacity: 0.5;
    background: #eee;
}

.corps-item-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
}

.corps-item-nom-container {
    flex: 1;
    min-width: 0;
    margin-right: 8px;
}

.corps-item-nom {
    font-weight: bold;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.corps-item-voir-detail {
    font-size: 11px;
    color: #666;
    cursor: pointer;
    margin-top: 2px;
    text-decoration: none;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.corps-item-voir-detail:hover {
    color: #333;
}

.corps-item-voir-detail::after {
    content: '▼';
    font-size: 8px;
    transition: transform 0.3s ease;
}

.corps-item-voir-detail.ouvert::after {
    transform: rotate(180deg);
}

.corps-item-couche {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
    display: none; /* Masquer la couche */
}

.corps-item-actions {
    display: flex;
    gap: 3px;
    margin-left: 8px;
}

.btn-corps-action {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-corps-action.visibilite {
    background: #4CAF50;
    color: white;
}

.btn-corps-action.visibilite:hover {
    background: #45a049;
}

.btn-corps-action.visibilite.off {
    background: #9E9E9E;
}

.btn-corps-action.visibilite.off:hover {
    background: #757575;
}

.btn-corps-action.isoler {
    background: #2196F3;
    color: white;
}

.btn-corps-action.isoler:hover {
    background: #0b7dda;
}

.btn-corps-action.transparent {
    background: #607D8B;
    color: white;
}

.btn-corps-action.transparent:hover {
    background: #455A64;
}

.btn-corps-action.transparent.active {
    background: #4CAF50;
}

/* Panneau de détail dépliable */
.corps-item-detail {
    margin-top: 10px;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.detail-row {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

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

.detail-label {
    font-weight: bold;
    font-size: 11px;
    color: #000;
    white-space: nowrap;
}

.detail-value {
    font-size: 11px;
    color: #333;
    word-break: break-word;
}

.corps-actions-groupees {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
    margin-top: 10px;
}

.btn-corps-all {
    width: 100%;
    padding: 10px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-corps-all:hover {
    background: #45a049;
}

.btn-corps-all.secondary {
    background: #607D8B;
}

.btn-corps-all.secondary:hover {
    background: #455A64;
}

.compteur-corps {
    text-align: center;
    font-size: 12px;
    color: #888;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 4px;
}

.corps-couche-separator {
    font-size: 11px;
    font-weight: bold;
    color: #4CAF50;
    text-transform: uppercase;
    padding: 8px 12px;
    margin: 10px 0 6px 0;
    background: #E8F5E9;
    border-radius: 4px;
    border-left: 3px solid #4CAF50;
}

/* Scrollbar pour la liste des corps */
.liste-corps::-webkit-scrollbar {
    width: 6px;
}

.liste-corps::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.liste-corps::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.liste-corps::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ==================== */
/* DÉCOUPAGE PAR PLANS  */
/* ==================== */

.plan-coupe-block {
    margin-bottom: 15px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.plan-coupe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.plan-coupe-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.plan-coupe-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.plan-coupe-nom {
    font-weight: bold;
    font-size: 13px;
}

.btn-inverser {
    background: transparent;
    color: #666;
    border: none;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.btn-inverser:hover {
    color: #333;
    transform: scale(1.2);
}

.plan-coupe-slider {
    display: flex;
    align-items: center;
    gap: 10px;
}

.plan-coupe-slider input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.plan-coupe-slider input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
    transition: all 0.2s;
}

.plan-coupe-slider input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.plan-coupe-slider input[type="range"]:disabled {
    opacity: 0.5;
}

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

.plan-coupe-valeur {
    min-width: 45px;
    text-align: right;
    font-size: 13px;
    font-weight: bold;
    color: #555;
}

.plan-coupe-options {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.plan-coupe-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
}

.plan-coupe-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.btn-reinitialiser-decoupage {
    width: 100%;
    padding: 10px;
    margin-top: 15px;
    background: #78909C;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-reinitialiser-decoupage:hover {
    background: #607D8B;
    transform: translateY(-1px);
}

/* ==================== */
/* MODAL                */
/* ==================== */

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 500px;
    max-width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-content h3 {
    margin-bottom: 20px;
}

.section {
    margin-bottom: 20px;
}

.section label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.section select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.section button {
    padding: 10px 15px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.section button:hover {
    background: #0b7dda;
}

#listePiecesSelectionnees {
    margin-top: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    min-height: 50px;
}

#listePiecesSelectionnees div {
    padding: 5px;
    margin: 5px 0;
    background: white;
    border-radius: 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#listePiecesSelectionnees button {
    background: #f44336;
    padding: 2px 8px;
    font-size: 12px;
}

.buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.buttons button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

#genererMaintenant {
    background: #4CAF50;
    color: white;
}

#genererMaintenant:hover {
    background: #45a049;
}

#annuler {
    background: #ddd;
}

#annuler:hover {
    background: #ccc;
}

#genererMaintenant:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ==================== */
/* BANDEAU SELECTION    */
/* ==================== */

#bandeauSelection {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #4CAF50;
    color: white;
    padding: 15px;
    text-align: center;
    z-index: 2000;
    font-size: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

#bandeauSelection button {
    background: white;
    color: #4CAF50;
    border: none;
    padding: 10px 20px;
    margin-left: 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

#bandeauSelection button:hover {
    background: #f0f0f0;
}

/* ==================== */
/* SYSTÈME D'AXES       */
/* ==================== */

#axesHelper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
    overflow: hidden;
}

#axesCanvas {
    width: 100%;
    height: 100%;
}

/* ==================== */
/* BOUTON RETOUR MENU   */
/* ==================== */

.btn-changer-projet {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 55px;
    height: 55px;
    padding: 0;
    background: linear-gradient(135deg, #FF9800 0%, #F44336 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 28px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-changer-projet:hover {
    background: linear-gradient(135deg, #F57C00 0%, #D32F2F 100%);
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

/* Bouton Sélection de zones (main) */
.btn-selection-zones {
    position: fixed;
    top: 95px;
    right: 20px;
    width: 55px;
    height: 55px;
    padding: 0;
    background: linear-gradient(135deg, #4CAF50 0%, #43A047 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 26px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-selection-zones:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.btn-selection-zones.actif {
    background: linear-gradient(135deg, #9C27B0 0%, #673AB7 100%);
    box-shadow: 0 0 20px rgba(156, 39, 176, 0.6);
}

/* Bouton Reset (flèche circulaire) */
.btn-reset-vue {
    position: fixed;
    top: 170px;
    right: 20px;
    width: 45px;
    height: 45px;
    padding: 0;
    background: linear-gradient(135deg, #4CAF50 0%, #43A047 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    z-index: 1500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-reset-vue:hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 5px 14px rgba(0,0,0,0.3);
}

.btn-reset-vue.avec-modification {
    background: linear-gradient(135deg, #9C27B0 0%, #673AB7 100%);
    box-shadow: 0 0 20px rgba(156, 39, 176, 0.6);
}

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

/* ==================== */
/* MODAL PROJET         */
/* ==================== */

.modal-projet {
    display: flex;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    align-items: center;
    justify-content: center;
}

.modal-projet-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    width: 600px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    animation: slideIn 0.3s ease;
}

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

.modal-projet-content h2 {
    margin-bottom: 10px;
    color: #333;
    font-size: 28px;
}

.modal-projet-content p {
    margin-bottom: 25px;
    color: #666;
    font-size: 16px;
}

.liste-projets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    max-height: 400px;
    overflow-y: auto;
}

.projet-card {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
}

.projet-card-supprimer {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.2s;
    padding: 4px;
    border-radius: 4px;
    line-height: 1;
}

.projet-card:hover .projet-card-supprimer {
    opacity: 1;
}

.projet-card-supprimer:hover {
    background: rgba(231, 76, 60, 0.2);
}

.projet-card:hover {
    background: linear-gradient(135deg, #4CAF50 0%, #2196F3 100%);
    border-color: #4CAF50;
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.projet-card-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.projet-card-nom {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.projet-card-format {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
}

.projet-card:hover .projet-card-format {
    color: rgba(255,255,255,0.8);
}

.modal-projet-info {
    background: #E3F2FD;
    border-left: 4px solid #2196F3;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
}

.modal-projet-info p {
    margin: 0;
    font-size: 14px;
    color: #1976D2;
}

.modal-projet-info code {
    background: rgba(33, 150, 243, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* ==================== */
/* STYLES COMMUNS MODALS */
/* ==================== */

.epaisseur-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.info-titre {
    font-weight: bold;
    color: #333;
    font-size: 0.95em;
    margin-bottom: 12px;
    text-align: center;
}

.info-ligne {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.info-ligne:last-child {
    margin-bottom: 0;
}

.info-label {
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
}

.info-valeur {
    color: #333;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    text-align: right;
}

.epaisseur-modification {
    margin-bottom: 25px;
}

.epaisseur-modification label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

.modification-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 15px;
}

.btn-quick {
    padding: 8px 12px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-quick:hover {
    background: #0b7dda;
    transform: translateY(-1px);
}

.input-delta {
    width: 80px;
    padding: 8px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.input-delta:focus {
    border-color: #4CAF50;
    outline: none;
}

.apercu-valeur {
    padding: 12px;
    background: #E3F2FD;
    border-left: 4px solid #2196F3;
    border-radius: 4px;
    text-align: center;
    font-size: 16px;
}

.valeur-apercu {
    font-weight: bold;
    font-size: 18px;
    font-family: 'Courier New', monospace;
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.btn-appliquer {
    flex: 1;
    padding: 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-appliquer:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-2px);
}

.btn-appliquer:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-annuler {
    flex: 1;
    padding: 12px;
    background: #ddd;
    color: #333;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-annuler:hover:not(:disabled) {
    background: #ccc;
}

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

/* Barre de chargement */
.barre-chargement {
    margin-top: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    border: 2px solid #2196F3;
}

.barre-chargement-titre {
    font-weight: bold;
    margin-bottom: 10px;
    color: #2196F3;
    text-align: center;
}

.barre-chargement-barre {
    width: 100%;
    height: 10px;
    background: #ddd;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.barre-chargement-progres {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #2196F3);
    animation: progressBar 2s infinite;
}

@keyframes progressBar {
    0% {
        width: 0%;
    }
    50% {
        width: 100%;
    }
    100% {
        width: 0%;
    }
}

.barre-chargement-etape {
    font-size: 13px;
    color: #666;
    text-align: center;
}

/* ============================================
   MODAL EXTRACTION PLAN 2D
   ============================================ */

.modal-extraction2d {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-extraction2d-content {
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    width: 500px;
    max-width: 92%;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-extraction2d-content h3 {
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #4CAF50;
    color: #333;
    font-size: 1.3em;
}

.extraction-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.extraction-info .info-ligne {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.extraction-info .info-label {
    font-weight: bold;
    color: #555;
    font-size: 0.9em;
}

.zones-liste {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.zone-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.85em;
    border: 1px solid #90caf9;
}

.plan-id-tag {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 0.78em;
    border: 1px solid #a5d6a7;
    font-weight: bold;
}

.plan-vue-tag {
    background: #fff8e1;
    color: #f57f17;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.75em;
    border: 1px solid #ffe082;
}

.extraction-section {
    margin-bottom: 20px;
}

.extraction-section .section-label {
    display: block;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    font-size: 0.95em;
}

.vues-checkboxes,
.options-checkboxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.vue-checkbox,
.option-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.vue-checkbox:hover,
.option-checkbox:hover {
    background: #e8e8e8;
}

.vue-checkbox input,
.option-checkbox input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.vue-checkbox span,
.option-checkbox span {
    font-size: 0.9em;
    color: #444;
}

.select-format {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    background: white;
    cursor: pointer;
}

.select-format:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.cartouche-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cartouche-fields .field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cartouche-fields label {
    font-size: 0.85em;
    color: #666;
}

.cartouche-fields input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
}

.cartouche-fields input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.modal-extraction2d-content .modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.modal-extraction2d-content .btn-extraire {
    flex: 2;
    padding: 12px 20px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-extraction2d-content .btn-extraire:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.modal-extraction2d-content .btn-extraire:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.modal-extraction2d-content .btn-annuler {
    flex: 1;
    padding: 12px 20px;
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-extraction2d-content .btn-annuler:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.modal-extraction2d-content .btn-annuler:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== */
/* MODAL ÉPAISSEUR SOUS-ZONE */
/* ==================== */

.modal-epaisseur-sous-zone {
    display: flex;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    align-items: center;
    justify-content: center;
}

.modal-epaisseur-sous-zone-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    width: 520px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    animation: slideIn 0.3s ease;
}

.modal-epaisseur-sous-zone-content h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 24px;
    border-bottom: 3px solid #9C27B0;
    padding-bottom: 10px;
}

.epaisseur-explication {
    background: #F3E5F5;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #9C27B0;
}

.epaisseur-explication p {
    margin: 0 0 8px 0;
    color: #4A148C;
}

.epaisseur-explication ul {
    margin: 0;
    padding-left: 20px;
}

.epaisseur-explication li {
    margin: 4px 0;
    font-size: 14px;
    color: #4A148C;
}

.apercu-operation {
    padding: 12px;
    background: #F3E5F5;
    border-left: 4px solid #9C27B0;
    border-radius: 4px;
    text-align: center;
    font-size: 16px;
    margin-bottom: 10px;
}

.operation-apercu {
    font-weight: bold;
    font-size: 18px;
    font-family: 'Courier New', monospace;
}

/* Bouton style violet pour la sous-zone */
.modal-epaisseur-sous-zone-content .btn-appliquer {
    flex: 1;
    padding: 12px;
    background: #9C27B0;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s;
}

.modal-epaisseur-sous-zone-content .btn-appliquer:hover:not(:disabled) {
    background: #7B1FA2;
    transform: translateY(-2px);
}

.modal-epaisseur-sous-zone-content .btn-appliquer:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ==================== */
/* VISUALISATION CFD    */
/* ==================== */

.cfd-boutons-resultats {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.btn-cfd-resultat {
    flex: 1;
    padding: 10px 12px;
    background: #f5f5f5;
    color: #333;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-cfd-resultat:hover:not(:disabled) {
    background: #e8e8e8;
    border-color: #bbb;
}

.btn-cfd-resultat.actif {
    background: #FF5722;
    color: white;
    border-color: #E64A19;
    box-shadow: 0 2px 8px rgba(255, 87, 34, 0.4);
}

.btn-cfd-resultat.cfd-indisponible {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Échelle de couleurs CFD */
#contenu-cfd {
    max-height: none;
    overflow: visible;
    padding: 0 20px 15px 20px;
}

#contenu-cfd.ferme {
    max-height: 0;
    padding: 0 20px;
    overflow: hidden;
}

.cfd-echelle {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.cfd-echelle-titre {
    font-size: 13px;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin-bottom: 8px;
}

.cfd-echelle-barre-container {
    position: relative;
    width: 100%;
}

.cfd-echelle-barre {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(to right, #5abbf1, #cde4c9, #d16730);
}

.cfd-echelle-graduations {
    position: relative;
    height: 25px;
    margin-top: 4px;
    width: 100%;
}

.cfd-echelle-tick {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
}

.cfd-echelle-tick::before {
    content: '';
    display: block;
    width: 1px;
    height: 6px;
    background: #999;
    margin: 0 auto;
}

.cfd-echelle-tick-label {
    font-size: 10px;
    color: #666;
    display: block;
    text-align: center;
    margin-top: 2px;
}

/* Opacité CFD */
.cfd-opacite {
    margin-top: 10px;
    padding: 0 5px;
}

.cfd-opacite-label {
    font-size: 13px;
    font-weight: bold;
    color: #555;
    display: block;
    margin-bottom: 8px;
}

.cfd-opacite-slider {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cfd-opacite-slider input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.cfd-opacite-slider input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
    transition: all 0.2s;
}

.cfd-opacite-slider input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.cfd-opacite-slider input[type="range"]:disabled {
    opacity: 0.5;
}

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

.cfd-opacite-valeur {
    min-width: 40px;
    text-align: right;
    font-size: 13px;
    font-weight: bold;
    color: #555;
}

/* ================================================================
   Section Uploads - Gestion des fichiers CFD et CAO
   ================================================================ */

.upload-champ {
    margin-bottom: 12px;
}

.upload-label {
    display: block;
    font-size: 12px;
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
}

.upload-requis {
    color: #e74c3c;
}

.upload-optionnel {
    color: #999;
    font-weight: normal;
}

.upload-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

.upload-select:focus {
    outline: none;
    border-color: #4CAF50;
}

/* Zone de dépôt de fichier stylisée */
.upload-zone {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 2px dashed #ccc;
    border-radius: 6px;
    background: #fafafa;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.upload-zone:hover {
    border-color: #4CAF50;
    background: #f0f9f0;
}

.upload-input-hidden {
    display: none;
}

.upload-zone-icone {
    font-size: 16px;
    flex-shrink: 0;
}

.upload-zone-texte {
    font-size: 12px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-hint {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

/* Bouton upload */
.btn-upload {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #4CAF50, #2196F3);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    margin-top: 4px;
    transition: opacity 0.2s, transform 0.1s;
}

.btn-upload:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-upload:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Messages de statut */
.upload-status {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
}

.upload-status--info {
    background: #e3f2fd;
    color: #1565c0;
}

.upload-status--succes {
    background: #e8f5e9;
    color: #2e7d32;
}

.upload-status--erreur {
    background: #fce4ec;
    color: #c62828;
}

/* Liste des fichiers uploadés */
.upload-liste-titre {
    font-size: 12px;
    font-weight: bold;
    color: #555;
    margin: 14px 0 6px 0;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.upload-liste {
    max-height: 140px;
    overflow-y: auto;
}

.upload-liste-vide {
    font-size: 12px;
    color: #aaa;
    text-align: center;
    padding: 8px 0;
    font-style: italic;
}

.upload-fichier-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 4px;
    background: #f5f5f5;
    margin-bottom: 4px;
    font-size: 12px;
}

.upload-fichier-nom {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;
}

.upload-fichier-taille {
    color: #999;
    flex-shrink: 0;
    font-size: 11px;
}

.upload-btn-supprimer {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 13px;
    flex-shrink: 0;
    transition: background 0.15s;
}

.upload-btn-supprimer:hover {
    background: #fce4ec;
}
