/******************************************************************************************************************************/
/*                                                                                                                            */
/*                                                              DROP DOWN                                                      */
/*                                                                                                                            */
/******************************************************************************************************************************/
.dd-container,
.dd-select,
.dd-options,
.dd-option {
    font-size: 0.6rem;
    font-family: var(--font-title);
    position: relative;
}

.dd-select,
.dd-option {
    max-height: 5rem;
}

.dd-option-text,
.dd-selected-text {
    line-height: 2.5rem !important;
    height: 5rem;
}

.dd-select {
    border-radius: 10px;
    background: transparent;
}

.dd-selected {
    padding: 0 !important;
}

.dd-option {
    padding: 0 !important;
}


/******************************************************************************************************************************/
/*                                                                                                                            */
/*                                                              FILE LOADER                                                   */
/*                                                                                                                            */
/******************************************************************************************************************************/

/***************** CSV PREVIEW *******************/

.file-preview,
.file-columns {
    height: auto;
    padding: 0 0.5rem;
    margin: 0.25rem 1rem;
    overflow: auto;
    border-width: 1px;
    border-radius: 10px;
    max-height: 50vh;
    border-width: 2px;
    width: 100%;
}

.file-preview th {
    text-align: left;
    padding: 10px;
}

#stream-file-loader-file-recorder {
    max-width: 150px;
}

/*Groupes d'options dans les datas */
.csv-settings {
    min-height: 1rem;
    padding: 0.5rem;
    margin: 0.25rem 1rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

/*Options unique*/
.csv-setting {
    display: flex;
    align-items: center;
    flex-direction: column;
    min-width: 40%;
    max-width: 50%;
    flex: 2;
}

/*Options unique*/
.csv-setting:last-of-type {
    flex: 1;
}

#stream-file-loader-csv-settings>.tabulator-row .tabulator-cell.csv-setting:last-of-type {
    min-width: 100%;
    max-width: 100%;
}

.file-columns-table tbody {
    display: block;
    min-height: 10rem;
    max-height: 100rem;
    overflow: auto;
}

.file-columns-table thead,
.file-columns-table tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.file-columns-table td {
    text-align: center;
    padding: 2px 10px;
    height: 1rem;
}

.file-columns-table tr:nth-child(2n+1) {
    background-color: #f8f8f8;
}

.file-columns-table tr:nth-child(2n+1)>td:first-of-type {
    background-color: #eaeaea;
}

.file-columns-table tr:nth-child(2n)>td:first-of-type {
    background-color: #f8f8f8;
}

.file-columns-table tr>td:last-of-type {
    border: 5px solid #9ccde573;
    border-radius: 5px;
}

.file-columns-table td {
    padding: 2px 10px;
}

.file-columns-table tr>td:nth-of-type(3) {
    border: 5px solid #9ccde573;
    border-radius: 5px;
    padding: 0;
}

.file-columns-table tr>td:last-of-type:hover {
    background-color: #fff;
    cursor: pointer;
}

.file-columns-table tr>td>select {
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    border: none;
    background-color: #fff;
    font-size: 0.6rem;
    font-family: var(--font-title);
}

.loader-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}


.loader-container,
.data-container {
    width: 100%;
    height: 100%;
    font-size: 0.6rem;
    /* overflow: auto; */
}

.loader-container fieldset,
.data-container fieldset {
    font-size: 0.5rem;
}

.data-container>form {
    margin: 0.5rem;
    /* border: 1px solid #fff; */
    height: 88%;
    /*overflow-y: auto;*/
}

.data-container>.form-header {
    padding: 0.5rem;
    display: inline-flex;
    width: 100%;
}

/* Nouveaux styles pour la structure séparée */
.data-container>.form-header-container {
    padding: 0.5rem;
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
}

.data-container>.form-header-container>.form-title-container {
    flex: 1;
    display: flex;
    align-items: center;
}

.data-container>.form-header-container>.form-buttons-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.data-container>.form-header>h2 {
    width: 100%;
    float: left;
}

/* Style pour le h2 dans la nouvelle structure */
.data-container>.form-header-container>.form-title-container>h2 {
    margin: 0;
    padding: 0;
}

/* Nouveaux styles pour les boutons en position fixed */
.form-buttons-container-fixed {
    position: absolute;
    top: -50px;
    right: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    justify-content: flex-end;
}

.picture-loader {
    width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
    text-align: center;
    align-items: center;
}

.file-loader {
    width: 100%;
    margin: 0.25rem auto;
    display: flex;
    flex-direction: column;
}

.loader-container {
    display: flex;
    flex-direction: column;
}


.loader-container .button,
.picture-loader .button,
.file-loader .button,
.branch-import-form .button {
    margin: 0.25rem auto;
    color: #fff;
    text-decoration: none;
    font-family: var(--font-title);
    background-color: var(--tertiary-color);
    padding: .4rem;
    text-shadow: none;
    display: flex;
    text-align: center;
    border-radius: .6rem;
    transition: all 0.2s ease;
    border: 0px;
    box-shadow: 5px 5px 0px var(--accent-color-select);
    justify-content: center;
    align-items: center;
    height: fit-content;
    z-index: 1;
    padding: 10px;
}

.loader-container .button {
    padding: 0.25rem auto;
    margin: 0;
}

.file-loader .button {
    padding: 0;
    margin: 0;
}

.form-buttons button.button {
    font-size: 0.88rem;
}

.form-buttons button.button:disabled {
    border: 1px solid #999999;
    background-color: #cccccc;
    color: #666666;
    box-shadow: 1px 1px 0px #000;
    cursor: not-allowed;
    transition: none;
    border-radius: 0.3rem;
}

.form-buttons button.button:disabled:hover {
    transform: none;
}

.loader-container .button:hover,
.picture-loader .button:hover,
.file-loader .button:hover,
.branch-import-form .button:hover {
    box-shadow: 3px 3px 0px var(--accent-color-select);
    background-color: var(--secondary-color);
    transition: all 0.2s ease;
    transform: translate(2px, 2px);
    cursor: pointer;
    border-radius: 1rem;
    z-index: 1;
}

/* 
.loader-container span:first-of-type {
    font-size: .7rem;
} */

.loader-container button:hover,
.picture-loader button:hover,
.file-loader button:hover {
    background-color: var(--accent-color-hover);
}

.loader-container button:disabled:hover,
.loader-container button[disabled]:hover,
.picture-loader button:disabled:hover,
.picture-loader button[disabled]:hover,
.file-loader button:disabled:hover,
.file-loader button[disabled]:hover,
.loader-container button:disabled,
.loader-container button[disabled],
.picture-loader button:disabled,
.picture-loader button[disabled],
.file-loader button:disabled,
.file-loader button[disabled] {
    border: 1px solid #999999;
    background-color: #cccccc;
    color: #666666;
    box-shadow: 2px 2px 0px #000;
    cursor: not-allowed;
    transition: none;
    border-radius: 0.5rem;
    height: 30px;
    transform: translate(0, 0);
}



.picture-loader .inputfile,
.file-loader .inputfile {
    display: none;
}

/***************** JSON LOADER *******************/
.json-viewer {
    color: #000;
    padding: 0.5rem;
    padding-left: 1rem;
    font-size: 1rem;
    font-family: var(--font-main);
    font-weight: bold;
    background-color: #fff;
    height: 95%;
    min-height: 10rem;
    overflow: auto;
}

/***************** DATAFORM *******************/
#form-data hidden-input {
    display: none;
}

#form-data {
    border: none;
}

fieldset>legend {
    font-size: 0.8rem;
}

#form-data>fieldset,
#form-db>fieldset {
    margin-top: 0.5rem;
    min-height: 5rem;
    border-radius: 10px;
}

#form-data>fieldset>div:last-of-type {
    padding-bottom: 10px;
}

#form-data div:first-of-type .thumbnail {
    width: 5rem;
    height: 5rem;
    margin: 0 5px 10px 0;
}

#form-data div.dd-container {
    margin: 0 1rem 0 auto;
    color: var(--tertiary-color);
    font-family: var(--font-title);
    font-size: 0.6rem;
    width: calc(100% - 10px) !important;
    border-radius: 5px !important;
    transition: all 0.3s ease;
    box-shadow: 2px 2px 0 var(--primary-color);
    min-height: 30px;
    background: white;
    border: 1px solid var(--primary-color);
    padding: 0;
    overflow: visible;
}

#form-data div>label {
    display: block;
    width: 100%;
    margin-top: 0.3rem;
    color: var(--primary-color);
    font-size: 0.7rem;
}

#form-data div.div-cb {
    display: flex;
}

#form-data div.div-cb>label {
    display: flex;
    margin-top: .65rem;
}

.csv-settings>label,
input.form-control>label {
    margin: 5px;
    height: 1rem;
}

.csv-settings>input:last-of-type {
    width: .9rem;
    height: .9rem;
    position: relative;
    margin: 0;
}

.csv-settings input[type=checkbox]:focus,
.csv-settings input[type=checkbox]:focus-visible {
    outline: none;
}

#form-data div>input[type=checkbox],
.csv-settings input[type=checkbox],
input[type=checkbox].form-control {
    margin: 0.5rem 0.25rem 0.25rem 0;
    font: inherit;
    color: currentColor;
    width: 1.1rem;
    height: 1.1rem;
    transform: translateY(-0.075rem);
}

#form-data div>input[type=range],
input[type=range].form-control {
    color: currentColor;
    width: 100%;
    border: none;
    padding: 0;
    box-shadow: none;
    height: auto;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
}

/* Règles spécifiques pour les checkboxes customisées dans .csv-settings */
.csv-settings .custom-checkbox-wrapper {
    position: relative !important;
    display: inline-block;
    margin: 0.5rem 0.25rem 0.25rem 0;
}

.csv-settings .custom-checkbox-wrapper input[type="checkbox"] {
    margin: 0 !important;
    transform: none !important;
}

.csv-settings .custom-checkbox {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    z-index: 1 !important;
}

.checkbox-wrapper {
    position: relative !important;
    display: inline-block;
    width: 23px;
}

.checkbox-wrapper input[type="checkbox"] {
    margin: 0 !important;
    transform: none !important;
}

.checkbox-wrapper .custom-checkbox {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    z-index: 1 !important;
}

input[type=checkbox] {
    min-height: auto !important;
}

/* 
#form-data div>*:focus,
.csv-settings *:focus {
    box-shadow: 0 0 .5rem var(--accent-color-hover);
}
    
#form-data datalist {
    display:none;
}*/


#form-data .select2-container {
    max-width: unset !important;
}

#form-data .select2-container>.selection>.select2-selection {
    color: var(--tertiary-color);
    font-family: var(--font-title);
    font-size: 0.7rem;
    width: calc(100% - 10px) !important;
    border-radius: 5px;
    transition: all 0.3s ease;
    box-shadow: 2px 2px 0 var(--primary-color);
    min-height: 30px;
    background: white;
    border: 1px solid var(--primary-color);
    padding: 0;
    padding-top: 0.2rem;
    padding-left: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}


.form-group-checkbox {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    margin: 0.5rem 0;
}

.form-group-checkbox>label {
    width: auto !important;
    margin-right: 10px !important;
}

.form-group-checkbox>input[type="checkbox"] {
    margin-right: auto !important;
}

/*#form-data nav > *, form div > * {
    font-size: 1.5rem;
    margin: .5rem 0;
}*/
/***************** DATATABLE *******************/
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
    color: #333;
    font-size: 0.6rem;
}

/***************** PICTURE *******************/

.picture {
    width: 100%;
    height: 100%;
    margin: auto;
    object-fit: contain;
}

/***************** THUMBNAIL *******************/
.form-buttons-container-fixed .thumbnail-btn:first-of-type {
    margin-left: 0.25rem;
    padding-left: 0.75rem;
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
}

.form-buttons-container-fixed .thumbnail-btn:last-of-type {
    margin-right: 0.25rem;
    padding-right: 0.75rem;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
}

/* Style spécifique quand il n'y a qu'un seul élément thumbnail-btn */
.form-buttons-container-fixed .thumbnail-btn:only-child {
    margin: 0;
    padding: 0.5rem;
    border-radius: 10px;
}


.thumbnail-container {
    height: 100%;
    min-height: 15rem;
    min-width: 15rem;
    display: block;
    margin: 0.5rem;
    border: solid 1px white;
}

.thumbnail {
    display: inline-block;
    max-width: 15rem;
    font-family: var(--font-title);
    font-size: calc(var(--header-height)/6);
    line-height: calc(var(--header-height)/6);
    color: var(--tertiary-color);
    background-color: rgb(255, 255, 255);
    margin: .25rem;
    vertical-align: top;
    position: relative;
    border-radius: 20px;
    padding: 15px;
}

.thumbnail:hover {
    cursor: pointer;
    background-color: rgba(187, 230, 250, 0.9);
}

.thumbnail>div>.thumbnail-name:first-of-type {
    width: 80%;
    float: left;
}

/* .thumbnail>div:first-of-type {
    height: 85%;
    border: solid 1px rgba(126, 126, 126, 0.4);
    background-color: none;
}

.thumbnail>div:last-of-type {
    width: 100%;
    display: inline-flex;
    word-wrap: break-word;
} */

.thumbnail>div>img {
    width: 100%;
    height: 100%;
    margin: auto;
    object-fit: contain;
}

.thumbnail>div:first-of-type .tooltiptext {
    display: inline-block;
    visibility: hidden;
    text-align: left;
    border-radius: 2px;

    bottom: 50%;
    left: 50%;
    white-space: nowrap;
    background-color: rgba(216, 219, 252, 0.8);
    color: var(--tertiary-color);
    font-size: 80%;
    padding: 0 0.5rem;
    box-shadow: 1px 1px 3px #222222;

    /* Position the tooltip */
    position: absolute;
    z-index: 1;
}

.thumbnail>div:first-of-type:hover .tooltiptext {
    visibility: visible;
}


/******************************************************************************************************************************/
/*                                                                                                                            */
/*                                                              CARDS                                                         */
/*                                                                                                                            */
/******************************************************************************************************************************/
#card {
    background-color: rgb(255, 255, 255);
    overflow: auto;
}

/***************** USER CARD *******************/
.card-user {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    font-family: var(--font-title);
    font-size: calc(var(--header-height)/5);
    line-height: calc(var(--header-height)/5);
    align-items: center;
}

.card-user>div {
    height: 100%;
    /* padding:.25rem;
    margin:.25rem; */
}

.card-user>div:first-of-type {
    position: relative;
    width: 30%;
    height: auto;
    background-image: url(/CLIENT_IMAGES/ATDx-bg.png);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    overflow: visible;
    transition: all 0.2s ease;
    box-shadow: 0px 0px 50px #00000080;
    border-radius: 50%;
    background-color: #0000003d;
}

.card-user>div:first-of-type:hover {
    overflow: hidden;
}

.card-user>div:first-of-type img {
    scale: 1;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.card-user>div:first-of-type:hover img {
    scale: 0.85;
    transition: all 0.3s ease;
}

.card-user>div:first-of-type::after {
    content: "";
    position: absolute;
    top: -22px;
    bottom: -17px;
    bottom: -17px;
    left: -14px;
    background-image: url(/CLIENT_IMAGES/ATDx-fg.png);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    opacity: 0.5;
    transition: all 0.3s ease;
    right: -20px;
}

.card-user>div:first-of-type:hover::after {
    opacity: 0;
    transition: all 0.3s ease;
}


.card-user>div:last-of-type {
    width: auto;
    display: flex;
    height: 100%;
    justify-content: center;
    align-items: flex-start;
}

.card-user>div>* {
    width: 100%;
    height: auto;
}


.user-pict-card {
    position: relative;
    width: 100px;
    height: 100px;
    margin: auto;
    border-radius: 50%;
    overflow: hidden;
    object-fit: cover;
    border: 2px solid #f0f0f0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}


.pict-card {
    width: 100%;
    height: auto;
    border-radius: 0;
}

.card-user>div:first-of-type::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: transparent;
    opacity: 0;
    pointer-events: none;
    transform: skewX(-30deg);
    background: linear-gradient(90deg, transparent 0%, white 45%, white 55%, transparent 100%);
    z-index: 10;
}

.card-user>div:first-of-type:hover::before {
    opacity: 0.5;
    animation: brillance 5s ease infinite;
}

@keyframes brillance {
    0% {
        left: -100%;
    }

    50%,
    100% {
        left: 200%;
    }
}

.table-user {
    width: 100%;
    height: 100%;
    margin: 0 auto;
    border: none;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-direction: column;
}

table.table-user tbody {
    height: 100%;
    margin: 0 auto;
    border: none;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-direction: column;

}

/* table.table-user tbody tr:first-of-type {} */

.table-user th,
.table-user td {
    text-align: center;
}

.table-user>tbody>tr>th {
    margin: 0;
    padding: 1rem 0;
}

/*.table-user > tbody > tr > td:first-of-type {
    width: 40%;
}*/

.group-right-card {
    text-align: left !important;
}


/*******************************************************************************************************************
*
*                                                   POPUP CARDS
*
********************************************************************************************************************/


.scoring-history-table {
    max-height: 300px;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.scoring-history-table table {
    margin: 0;
    font-size: 13px;
    min-width: 100%;
}

.scoring-history-table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-align: center;
    padding: 8px 6px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.scoring-history-table td {
    background-color: #f8f9fa;
    padding: 6px;
    text-align: center;
    vertical-align: middle;
}

.scoring-history-table td:first-child {
    text-align: left;
}

.score-badge {
    display: inline-block;
    min-width: 24px;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    color: white;
    padding: 2px 8px;
    line-height: 24px;
}

.score-icons-container {
    display: inline-flex;
    flex-direction: row-reverse;
    margin-left: 0px;
    background-color: #3b8cba;
    padding: 3px 5px;
    border-radius: 5px;
}

/* Style pour les valeurs de score non définies (NULL) */
.score-null {
    color: #999;
    font-style: italic;
}

.loading-indicator,
.no-data,
.error-message {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

.loading-indicator i {
    margin-right: 8px;
}

.no-data i,
.error-message i {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

th.header-card-level>span,
th.header-card-level>a,
.icon-popup {
    z-index: 2;
    position: relative;
}

.header-card-level {
    position: relative !important;
    overflow: hidden !important;
    color: rgb(255, 255, 255) !important;
}

.header-card-level::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    /* Ajuste l’opacité pour l’assombrissement */
    pointer-events: none;
    z-index: 1;
}

/*PASTILLE*/
.round-span {
    height: 50px;
    width: 50px;
    border-radius: 50%;
    display: flex;
}

.icon-popup {
    margin: 0 .5rem;
    vertical-align: middle;
    width: 2rem;
}

.card-popup {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
    font-family: var(--font-title);
    font-size: calc(var(--header-height)/7);
    line-height: var(--header-height)/6;
    background-color: rgb(255, 255, 255);
    width: 100%;
    height: 100%;
    overflow: auto;
}

.leaflet-popup-content {
    max-width: 580px;
}

.popup_1000 {
    width: 1000px;
}

.popup_500 {
    width: 500px;
}

.popup_700 {
    width: 700px;
}

.card-popup>div {
    height: 100%;
    width: 100%;
    overflow-x: auto;
    /* max-width: 580px; */
    /* padding:.25rem;
    margin:.25rem; */
}

.card-popup>div>* {
    width: 100%;
    height: 100%;
    border-collapse: collapse;
}

.card-popup table {
    border-collapse: collapse;
}

.card-popup table td,
.card-popup table th {
    padding: 5px;
    outline: 1px dotted var(--primary-color);
}

.table-header-popup {
    width: 100%;
    height: 100%;
    margin: 0 auto;
    border: none;
}

.card-popup>fieldset {
    height: 17rem;
    width: 100%;
    padding: 0.5rem;
    margin: 0.25rem 0.5rem;
    border: 1px solid var(--tertiary-color);
}

.table-element-popup {
    width: 100%;
    max-height: 20rem;
    margin: 0 auto;
    border: none;
    font-size: calc(var(--header-height)/7);
    line-height: calc(var(--header-height)/7);
}

.table-element-popup th,
.table-element-popup td {
    padding: 0 .2rem;
    font-weight: normal;
}

.table-element-popup>tbody>tr {
    outline: 2px solid #ffffff87;
    outline-offset: -5px;
    border-radius: 20px;
}

.table-element-popup>tbody>tr:nth-child(2n+1) {
    background-color: lightgrey;
}

/*.table-element-popup > tbody > tr:hover,
.table-element-popup > tbody > tr:nth-child(2n):hover
{
    border:1px solid var(--tertiary-color);
    background:var(--accent-color-hover);
    color:lightblue;
}*/

.table-element-popup th {
    background: var(--tertiary-color);
    color: lightblue;
}

.table-element-popup>tbody {
    overflow-y: auto;
    text-align: center;
}

.table-header-popup th,
.table-header-popup td {
    text-align: left;
}


.table-header-popup>tbody>tr>th {
    margin: 0;
    padding: 1rem 0;
    background: var(--tertiary-color);
    color: white;
    padding-left: 0.5rem;
}

main#main-container #main-content-card #card .card-popup .table-header-popup>tbody>tr>th {
    padding-top: calc(1rem + var(--header-height));
}


.table-header-popup>tbody>tr>th>a {
    color: white;
}

.table-header-popup>tbody>tr>th>a:hover {
    color: lightblue;
}

.table-header-popup>tbody tr,
.table-header-popup>tbody td {
    background-color: var(--accent-color-focus);
    padding: 0.25rem;
}

.table-header-popup>tbody>tr>td:first-of-type {
    width: 10rem;
    vertical-align: middle;
    font-weight: bold;
    /*padding: 0.5rem;*/
}

/* --- HARMONISATION FORMULAIRE IMPORT BRANCHES --- */
.branch-import-form {
    padding: 1.5rem 1rem 1.5rem 1rem;
    background: #fff;
    border-radius: 10px;
    max-width: 60vw;
    min-width: 600px;
    width: 100%;
    margin: 1.5rem auto;
    border: 1px solid rgba(66, 139, 202, .25);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.branch-import-form fieldset {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.2rem 1rem 0.5rem 1rem;
    margin-bottom: 1.5rem;
    background: none;
}

.branch-import-form legend {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--tertiary-color);
    margin-bottom: 1rem;
    background: none;
    padding: 0;
}

.branch-import-form .form-field-container {
    margin-bottom: 1.2rem;
}

.branch-import-form .form-group {
    margin-bottom: 0.5rem;
}

.branch-import-form label {
    font-size: 0.95em;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.branch-import-form input.form-control,
.branch-import-form select.form-control {
    font-size: 0.95em;
    padding: 0.4em 0.7em;
    border-radius: 5px;
    border: 1px solid #bfc9d1;
    background: #fafbfc;
    margin-bottom: 0.2rem;
}

.branch-import-form .help-block {
    font-size: 0.7em;
    color: #888;
    margin-top: 0.1rem;
    margin-bottom: 0.2rem;
}

.form-buttons {
    margin-top: 15px;
}

.branch-import-form .form-buttons {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.branch-import-form .button {
    min-width: 120px;
    font-size: .7rem;
    padding: 10px;
}

/* --- FORMULAIRE IMPORT ALTÉRATIONS --- */

#import-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#import-form-container {
    width: 100%;
}

#import-form-container .import-alt-container {
    padding: 1.5rem 1rem 1.5rem 1rem;
    background: #fff;
    border-radius: 10px;
    max-width: 60vw;
    min-width: 600px;
    width: 100%;
    margin: 1.5rem auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(66, 139, 202, .25);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

#import-form-container .loader-container h2 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--tertiary-color);
    margin-bottom: 1rem;
    background: none;
    padding: 0;
}

#import-form-container .loader label {
    font-size: 0.95em;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

#import-form-container input.form-control,
#import-form-container select.form-control {
    font-family: var(--font-title);
    font-size: 0.7em;
    padding: 0.4em 0.7em;
    border-radius: 5px;
    border: 1px solid #bfc9d1;
    background: #fafbfc;
    margin-bottom: 0.5rem;
    width: 100%;
}

#import-form-container .help-block {
    font-size: 0.5em;
    color: #888;
    margin-top: 0.1rem;
    margin-bottom: 0.2rem;
}

/* #import-form-container .button {
    min-width: 120px;
    font-size: 1em;
    padding: 0.5em 1.2em;
    border-radius: 6px;
    background: var(--tertiary-color);
    color: #fff;
    border: none;
    transition: background 0.2s;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

#import-form-container .button:disabled {
    background: #cccccc;
} */

/* Styles pour le bouton de refresh global */
.global-refresh-button-container {
    position: absolute;
    top: 0px;
    right: 0px;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0;
    border-bottom-left-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.global-refresh-button {
    width: 50px;
    height: 50px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.2rem;
    padding: 0;
    margin: 0;
}

.global-refresh-button-container i {
    transform: scale(1);
    color: var(--tertiary-color);
    transition: all 0.3s ease;
}

/* Effets hover sur le conteneur */
.global-refresh-button-container:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    background-color: var(--accent-color-clear);
}

.global-refresh-button-container:hover i {
    color: var(--primary-color);
    transform: scale(1.2);
}

.global-refresh-button .fa-spin {
    animation-duration: 1s;
}

/* Désactiver le bouton pendant l'animation */
.global-refresh-button:has(.fa-spin),
.global-refresh-button .fa-spin {
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Alternative pour les navigateurs qui ne supportent pas :has() */
.global-refresh-button.loading {
    cursor: not-allowed !important;
    pointer-events: none;
}

input:checked+.slider {
    background-color: var(--accent-color-focus);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--tertiary-color);
}

input:checked+.slider:before {
    transform: translateX(20px);
}


/* Styles pour les switches du menu */
.switch-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    transition: all 0.2s ease;
    border-right: 5px solid var(--primary-color) !important;
}

li.menu-item-rebuild-alteration-geometries {
    border-right: 5px solid var(--primary-color) !important;
}

.switch-item:not(.cascade-enabled:hover):not(.dependency-highlight):hover,
li.menu-item-rebuild-alteration-geometries:hover {
    border-right: 5px solid var(--accent-color-select) !important;
}

/* Styles pour les menus de calculs déjà effectués */
.switch-item.calculation-disabled {
    background-color: var(--primary-color);
}

.switch-item.calculation-disabled.dependency-highlight,
.switch-item.calculation-disabled.dependency-highlight:hover {
    border-left: 10px solid var(--accent-color-select) !important;
}

.switch-item.calculation-disabled:hover {
    background-color: var(--tertiary-color) !important;
    border-left: 10px solid var(--secondary-color) !important;
}

/* Styles pour les calculs terminés */
.switch-item.calculation-done {
    border-right: 5px solid var(--bk-color-th-1) !important;
}

/* Effet de hover pour montrer les calculs de cascade */
.switch-item.cascade-enabled:hover {
    border-right: 5px solid var(--accent-color-select) !important;
}

/* Mise en évidence des calculs précédents lors du hover sur un bouton avec cascade activé */
.switch-item.cascade-enabled:hover .switch-item {
    /* border-right: 3px solid rgba(0, 123, 255, 0.5); */
    background-color: rgba(0, 123, 255, 0.05);
    transition: all 0.3s ease;
}

/* Mise en évidence spécifique pour les calculs de dépendances */
.switch-item.cascade-enabled:hover~.switch-item.menu-item-compute-collapse-probabilities {
    border-right: 3px solid rgba(0, 123, 255, 0.7);
    background-color: rgba(0, 123, 255, 0.1);
}

.switch-item.cascade-enabled:hover~.switch-item.menu-item-compute-risks {
    border-right: 3px solid rgba(0, 123, 255, 0.7);
    background-color: rgba(0, 123, 255, 0.1);
}

.switch-item.dependency-highlight a {
    color: var(--accent-color-focus) !important;
    font-weight: 500;
}

.switch-item.dependency-highlight .switch-container {
    opacity: 1 !important;
}

.switch-item.cascade-disabled {
    border-right: 5px solid var(--dark-color-5);
    opacity: 0.8;
}

/* Styles pour les états de cascade */
/* .switch-item.cascade-enabled {
} 

.switch-item.cascade-disabled.dependency-highlight {
}*/

.switch-item.cascade-disabled .switch-container {
    opacity: 0.8;
}

.switch-item.cascade-disabled:hover .switch-container {
    opacity: 0.9;
}

.switch-item.cascade-disabled:hover .switch-container:hover {
    opacity: 1;
}

.switch-item.cascade-enabled .switch-container {
    opacity: 0.9;
}

.switch-item.cascade-enabled .switch-container:hover {
    opacity: 1;
}

/* Styles pour les boutons désactivés */
.switch-item.cascade-disabled.button-disabled {
    opacity: 0.6;
    filter: grayscale(30%);
}

/* Styles pour les éléments mis en évidence par JavaScript */
.switch-item.dependency-highlight {
    border-right: 5px solid var(--accent-color-focus) !important;
    background-color: rgba(0, 123, 255, 0.1);
    transition: all 0.3s ease;
    opacity: 1 !important;
    filter: grayscale(0%) !important;
}

/* 
.switch-item.button-disabled a {
    color: #6c757d !important;
    text-decoration: line-through;
} */

/* .switch-item.button-disabled:hover {
    background-color: rgba(0, 0, 0, 0.1) !important;
} */

/* Le toggle cascade reste toujours fonctionnel même si le bouton est désactivé */
.switch-item.button-disabled .switch-container {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.switch-item.button-disabled .switch-container input[type="checkbox"] {
    pointer-events: auto !important;
}

.switch-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.switch-item .menu-content {
    display: flex;
    align-items: center;
    flex: 1;
}

.switch-item .icon-menu {
    margin-right: 8px;
}

.switch-item a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.switch-item a i {
    margin-right: 8px;
}

.switch-item.calculation-disabled a {
    color: #6c757d;
}

.switch-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 5px;
    transform: scale(0.8);
    background: var(--primary-color);
    border-radius: 10px;
    box-shadow: 2px 2px var(--accent-color);
    position: relative;
    width: 20px;
    height: 20px;
    margin-right: 15px;
    margin-top: -2px;
    transition: all 0.5s ease;
}

.switch-item:hover .switch-container {
    height: 30px;
    width: 50px;
    transform: scale(0.9);
}


/* Bouton Semi-grisé si option déja calculé */
.switch-item.calculation-disabled .switch-container {
    opacity: 0.3;
}


/* Switch toggle styles */
li.switch-item .switch-container .switch {
    position: relative;
    display: inline-block;
    transform: scale(0.8);
    opacity: 0;
    width: 0px;
    height: 0px;
    transition: all 0.5s ease;
}

.switch-container:hover .switch {
    transform: scale(1);
}

.switch-item:hover .switch-container .switch {
    width: 40px;
    height: 20px;
    opacity: 1;
}

.switch-item.cascade-disabled .switch-container .switch {
    opacity: 0;
    width: 0px;
    height: 0px;
}

.switch-item.cascade-disabled:hover .switch-container .switch {
    width: 40px;
    height: 20px;
    opacity: 1;
}

.switch-item.cascade-enabled .switch-container .switch {
    opacity: 1;
    /* width: 0px;
    height: 0px; */
}



/* Label "dépendances" au-dessus des switches */
.switch-container .switch-dependencies-label {
    line-height: 0;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    font-size: 0.8em;
    color: var(--accent-color-hover);
    text-align: center;
    margin-bottom: 10px;
    margin-top: -10px;
    font-weight: normal;
    letter-spacing: 0.5px;
    text-transform: capitalize;
    padding: 0;
    opacity: 0;
    transition: all 0.5s ease;
    width: 0px;
    height: 0;
    display: flex;
}

.switch-item:hover .switch-container .switch-dependencies-label {
    color: var(--accent-color-select);
    opacity: 1;
}

.switch-item:hover .switch-container:hover .switch-dependencies-label {
    color: var(--accent-color-clear);
}

.switch-label {
    font-size: 0.75em;
    color: #666;
    margin-left: 8px;
    white-space: nowrap;
    transition: 0.5s ease;
}

.switch-item .switch input {
    opacity: 0;
    width: 0;
    height: 0;
    transition: 0.5s ease;
}

.switch-item .switch-container .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transition: 0.3s;
    border-radius: 20px;
    background-color: black;
    transition: 0.5s ease;
}

.switch-item.cascade-enabled .switch-container .slider {
    top: 10px;
    left: -30px;
    opacity: 0.6;
}

.switch-item.cascade-enabled:hover .switch-container .slider {
    top: 0;
    left: 0;
    opacity: 1;
}


.switch-item:hover .switch-container .slider {
    width: 40px;
    height: 20px;
    opacity: 1;
}

.switch-item .switch-container .slider::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    top: 2px;
    bottom: 2px;
    background-color: white;
    transition: all 0.3s;
    border-radius: 50%;
    opacity: 1;
}

.switch-item.cascade-enabled .switch-container .slider::before {
    left: 3px;
    top: -17px;
}


.switch-item.cascade-enabled:hover .switch-container .slider::before {
    left: 2px;
    top: 2px;
}

.switch-item.cascade-disabled .switch-container .slider::before {
    height: 0px;
    width: 0px;
    opacity: 0;
}

.switch-item.cascade-disabled:hover .switch-container .slider::before {
    height: 16px;
    width: 16px;
    opacity: 1;
}

.switch input:checked+.slider {
    background-color: var(--accent-color-focus);
}

.switch input:focus+.slider {
    box-shadow: 0 0 1px var(--tertiary-color);
}

.switch input:checked+.slider::before {
    transform: translateX(20px);
}

.switch-item.cascade-enabled:hover input:checked+.slider::before {
    transform: translateX(20px);
}

.switch-item.cascade-enabled input:checked+.slider::before {
    transform: translateX(20px);
}



/* Responsive design pour les switches */
@media (max-width: 768px) {
    .switch-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .switch-container {
        margin-left: 0;
        align-self: flex-end;
    }

    .switch-label {
        font-size: 0.7em;
    }
}


/* Bouttons de tabeau (plus utilisés?) */
.my-bg-blue {
    background-color: var(--primary-color);
}

.my-bg-blue.active {
    background-color: var(--secondary-color);
}

.my-bg-blue i {
    color: white;
}



/* ====================================================
 * CUSTOM CHECKBOX SYSTEM
 * ====================================================*/

/* Styles génériques pour les checkboxes customisées */
/* label.switch-label {
    position: relative;
    display: inline-block;
} */

/* Règle pour que les parents des checkboxes aient position: relative */
/* input[type="checkbox"] {
    opacity: 0;
    width: 1.2em;
    height: 1.2em;
    margin: 0;
    position: relative;
    z-index: 2;
    cursor: pointer;
} */

/* Forcer le parent à avoir position: relative pour le positionnement absolu */
/* input[type="checkbox"]:has(+ .custom-checkbox),
input[type="checkbox"] + .custom-checkbox {
    position: relative;
} */

/* Alternative pour les navigateurs qui ne supportent pas :has() */
/* .custom-checkbox-wrapper {
    position: relative !important;
    display: inline-block;
} */

/* input[type="checkbox"] + .custom-checkbox {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    border: 2px solid var(--accent-color-focus);
    border-radius: 3px;
    background: #0a223a;
    margin-right: 0.5em;
    vertical-align: middle;
    transition: all 0.2s ease;
    box-sizing: border-box;
    position: absolute;
    left: 0;
    top: 0;
    cursor: pointer;
    z-index: 1;
}

#table-sites input[type="checkbox"] + .custom-checkbox {
    width: 1.2em;
    height: 1.2em;
}

/* Ajustements de mise en page pour le tableau des sites */
/* #table-sites {
    table-layout: auto;
    border-collapse: collapse;
} */

#table-sites td:first-child {
    width: 2rem;
    text-align: center;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

/* Rendre le custom checkbox visible et correctement dimensionné dans #table-sites */
#table-sites .checkbox-wrapper {
    width: 1.4em;
    /* conteneur légèrement plus large que la case */
    height: 1.4em;
    position: relative;
    /* référentiel pour le positionnement absolu */
}

#table-sites .checkbox-wrapper .custom-checkbox {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
    /* sous l'input pour laisser passer le clic */
    pointer-events: none;
    /* ne capte pas le clic, laisse l'input recevoir */
    display: inline-block;
    box-sizing: border-box;
    width: 1.2em;
    height: 1.2em;
    border: 2px solid var(--accent-color-focus);
    border-radius: 3px;
    background: #eff7ff;
}

/* Optionnel: masquer visuellement la case native tout en gardant la clicabilité */
#table-sites .checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 2;
    /* au-dessus pour capter le clic */
    opacity: 0;
    /* invisible mais cliquable */
    width: 1.2em;
    height: 1.2em;
    margin: 0;
}

input[type="checkbox"]:hover+.custom-checkbox,
input[type="checkbox"]:checked:hover+.custom-checkbox,
.custom-checkbox:hover,
.custom-checkbox.checked:hover {
    border-color: rgb(188, 225, 255);
    border-radius: 5px;
    outline: 1px solid rgb(188, 225, 255);
}

input[type="checkbox"]:checked+.custom-checkbox,
.custom-checkbox.checked {
    outline: 1px solid var(--tertiary-color);
    outline-offset: 2px;
    background: #0a223a !important;
    border-radius: 4px;
    color: var(--tertiary-color) !important;
}

input[type="checkbox"]:focus+.custom-checkbox,
.custom-checkbox:focus {
    box-shadow: 0 0 0 2px var(--accent-color-focus);
    border-color: var(--primary-color);
    border-radius: 4px;
}

input[type="checkbox"]:disabled+.custom-checkbox {
    background: #444;
    border-color: #888;
    cursor: not-allowed;
    border-radius: 1px;
}

*/
/* Styles pour les checkboxes avec couleurs de modules */
/*.custom-checkbox[data-module-color] {
    border-color: var(--module-color) !important;
    background: var(--module-color-light) !important;
}

input[type="checkbox"]:hover + .custom-checkbox[data-module-color],
input[type="checkbox"]:checked:hover + .custom-checkbox[data-module-color],
.custom-checkbox:hover[data-module-color],
.custom-checkbox.checked:hover[data-module-color] {
    border-color: var(--module-color-dark) !important;
    outline: 1px solid var(--module-color-dark) !important;
}

input[type="checkbox"]:checked + .custom-checkbox[data-module-color],
.custom-checkbox.checked[data-module-color] {
    outline: 1px solid var(--module-color) !important;
    background: white !important;
    color: var(--module-color) !important;
}

input[type="checkbox"]:focus + .custom-checkbox[data-module-color],
.custom-checkbox:focus[data-module-color] {
    box-shadow: 0 0 0 2px var(--module-color) !important;
    border-color: var(--module-color-dark) !important;
}
*/


.context-target-buttons {
    padding-top: 10px;
}

.context-target-buttons button {
    width: 100%;
    color: white;
    padding: 10px 8px;
    cursor: pointer;
    background: rgba(1, 42, 83, 0.3);
    border-radius: 20px;
    box-shadow: -5px 3px 0 #72afd28a;
    padding: 10px;
    margin: 10px 0px;
    color: var(--accent-color-clear);
    outline: 2px solid #72afd28a;
    outline-offset: -1px;
    transition: all .1s ease;
    transform: translate(0px, 0px);
    font-size: 0.7rem;
    position: relative;
    overflow: hidden;
}

/* Effet de reflet diagonal au survol */
.context-target-buttons button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            rgba(255, 255, 255, 0.3),
            rgba(255, 255, 255, 0.1),
            transparent);
    z-index: 1;
    pointer-events: none;
}

.context-target-buttons button:hover::before {
    left: 100%;
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.context-target-buttons button:hover {
    box-shadow: -3px 4px 0 var(--accent-color-focus);
    transform: translate(-1px, -1px);
    background: rgba(1, 42, 83, 0.6);
    transform: scale(1.05);
}


.context-target-buttons button:disabled {
    background: rgba(95, 95, 95, 0.3);
    color: #666666;
    box-shadow: -1px -1px 0 rgba(0, 0, 0, 0.5);
    transform: translate(-2px, -2px);
    outline: 2px solid #666666;
}

.dashboard-controls .context-target-buttons button {
    background-color: var(--primary-color);
    border-radius: 30px;
    padding: 5px 15px;
    width: auto;
    min-height: 30px;
    outline: none;
    box-shadow: 2px 4px 0 rgba(255, 255, 255, 0.5);
    margin: 0;
}

.dashboard-controls .context-target-buttons button:hover {
    transform: translate(1px, 1px);
    background-color: var(--accent-color);
}

.dashboard-controls .context-target-buttons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* Styles personnalisés pour le bouton sidebar-target-map */
.sidebar-target-map-custom {
    min-width: 0 !important;
    display: inline-flex;
    align-items: center;
}

/* Styles spécifiques pour le placeholder (pas de width mais garde min-width: 0 pour transition) */
.target-map-placeholder.sidebar-target-map-custom {
    width: auto;
    min-width: 0 !important;
    display: inline-flex;
    align-items: center;
    cursor: not-allowed;
}

/* Ajustement du max-width pour le placeholder en mode ouvert */
.target-map-placeholder.sidebar-target-map-custom.show-text .sidebar-target-map-text {
    max-width: none;
}

.sidebar-target-map-custom .sidebar-target-map-text {
    opacity: 0;
    max-width: 0;
    margin-right: 0;
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    transition: opacity 0.5s ease, max-width 0.5s ease, margin-right 0.5s ease;
    justify-content: center;
    align-items: center;
}

.sidebar-target-map-custom.show-text .sidebar-target-map-text {
    opacity: 1;
    max-width: 300px;
    margin-right: 8px;
}

.sidebar-target-map-custom.hide-text .sidebar-target-map-text {
    opacity: 0;
    max-width: 0;
    margin-right: 0;
}