#devis-app{
    display: flex;
}

#editable-devis{
    width: 70%;
    margin: 1em;
    background-color: white;
    padding: 1em;
    font-size: 0.8rem;
}

/*==============================================================================
                    rules for the header of the devis                                                                        
==============================================================================*/
.devis-header{
    margin-bottom: 1em;
}

.devis-header > div{
    display: flex;
    justify-content: space-between;
}

.devis-header > div > *{
    flex: 1;
}

.devis-header table{
    border-collapse: collapse;
    width: 100%;
}

.devis-header table td,
.devis-header table th{
    border: 1px solid black;
    text-align: center;
}

/*==============================================================================
rules for the class : articles-table used in for the devis and
in the modal window when you select an article                                                                          
==============================================================================*/
table.articles-table{
    border-collapse: collapse;
    border: 1px solid black;
    font-size: 0.8rem;
}

table.articles-table thead{
    border: 1px solid black;
}

table.articles-table thead th{
    text-align: center;
    background-color: darkgray;
}

table.articles-table td,
table.articles-table th{
    border-left: 1px solid black;
    border-right: 1px solid black;
    padding: 0.5em 0.4em 0.5em 0.4em;
    text-align: start;

}

table.articles-table td:nth-child(3),
table.articles-table td:nth-child(6) {
    text-align: right;
}

/*==============================================================================
                    rules for the footer of the devis                                                                        
==============================================================================*/
div.devis-footer{
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 1em;
    
}

div.devis-footer table{
    border-collapse: collapse;
    border: 1px solid black;
}

div.devis-footer table:first-child td{
    border: 1px solid black;
    padding: 0.6em;
}

div.devis-footer table:last-child td{
    border-left: 1px solid black;
    border-right: 1px solid black;
    padding: 0.6em;
}

div.devis-footer table:last-child th{
    border: 1px solid black;
    padding: 0.6em;
}

/*==============================================================================
                            rules for editable devis                                                                       
==============================================================================*/

#editable-devis textarea{
    width: 100%;
    height: 100%;   
    box-sizing: border-box; /* important */
    padding: 0;             /* optionnel */
    margin: 0;              /* optionnel */
    border: none;           /* si tu veux qu’il colle vraiment aux bords */
    resize: none; 
}

#editable-devis .devis-header th input{
    width: 100% !important;
    height: 100%;
    border: none; 
    padding: 0;
    margin: 0;
    text-align: center;
}


#editable-devis .devis-body{
    width: 100%;
}

#editable-devis .devis-body td:nth-child(2){
    width: 40%;
}

#editable-devis .devis-body .add-buttons{
    text-align: center;
}

#editable-devis .devis-body .add-buttons button{
    width: 20%;
    margin: 0 1em;
}


#editable-devis .devis-body input[type="number"]{
    width: 4em;
}

#editable-devis .devis-body input[type="number"].remise{
    width: 3em;
}

#editable-devis .devis-body .remise-fixed{
    display: inline-block;
    width: 3em;
    text-align: center;
    color: #888;
}

#editable-devis .devis-body input[type="text"]{
    width: 100%;
}

#editable-devis .devis-header input[type="text"]{
    width: 70%;
}

#editable-devis .devis-header textarea.header-texte-libre {
    width: 100%;
    box-sizing: border-box;
    margin-top: 0.5em;
    resize: vertical;
}

#devis-pdf .devis-header p.header-texte-libre {
    margin-top: 0.5em;
    white-space: pre-wrap;
}

td:has(.devis-edit) {
    padding: 0 !important;
}
/* Display flex the edit section */
div.devis-edit{
    display: flex;
    gap: 0.5em;
    margin-left: 0.5em;
}

/* Set the column for the div of up down buttons */
div.devis-edit div{
    display: flex;
    flex-direction: column;
}

/* Set the size for the up and down button */
div.devis-edit div > button{
    height: 13px;         
    width: 26px;          
    padding: 0;
    display: flex;             
    justify-content: center;   
    align-items: center;       
}

/* Set the size for the edit and remove button */
div.devis-edit > button {
    height: 26px;         
    width: 26px;          
    padding: 0;           
}

#editable-devis .hint {
    border-radius: 50%;
    border: 0.5px solid #666;
    box-shadow: none;
}

/* Center the add button */
#editable-devis table.devis-body td[colspan="5"]{
    text-align: center;
    gap: 1em;
}

/* increase the width of the add button */
#editable-devis table.devis-body td[colspan="5"] button{
    width: 25%;
    margin: 0 0.5em;
}


#editable-devis .devis-footer input{
    width: 3em;
}

/*==============================================================================
                            rules for pdf devis       
All of these rules are just to manage properly tables for html2pdf                                                                
==============================================================================*/
#devis-pdf{
    font-size: 0.7rem;
}
#devis-pdf .articles-table{
    font-size: 0.7rem;
}

#devis-pdf table{
    border: 1px solid black;
}

#devis-pdf tr{
    border: none;
    border-bottom: 1px solid black;
}

#devis-pdf tr:last-child{
    border: none;
}

#devis-pdf td,
#devis-pdf th
{
    border: none;
    border-right: 1px solid black;
}

#devis-pdf td:last-child,
#devis-pdf th:last-child
{
    border: none;
}

#devis-pdf .devis-body{
    width: 100%;
}

#devis-pdf .devis-body td:nth-child(4),
#devis-pdf .devis-body td:nth-child(5),
#devis-pdf .devis-body td:nth-child(6),
#devis-pdf .devis-body td:nth-child(7)
{
    text-align: right;
}

#devis-pdf .devis-body tr{
    border: none;
}

#devis-pdf .devis-body thead th{
    border-bottom: 1px solid black;
}

#devis-pdf .devis-footer table:last-child tr:first-child{
    border: none;
}

#devis-pdf .devis-header > table tr:last-child td{
    height: 30px;
}


/*==============================================================================
                            RULES OF MODAL                                                                        
==============================================================================*/

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1em;
}

.breadcrumb button {
    background: none;
    border: none;
    color: #0077cc;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.breadcrumb button:hover {
    background-color: rgba(0, 119, 204, 0.1);
}

.breadcrumb button::after {
    content: ">";
    margin-left: 0.4rem;
    color: #888;
}

.breadcrumb button:last-child::after {
    content: "";
}

.breadcrumb button:last-child{
    font-weight: bold;
}


div.modal-category {
    flex: 1 1 auto;       /* ← prend l’espace restant */
    min-height: 0;        /* ← SUPER IMPORTANT pour éviter le débordement */
    overflow-y: auto;    /* scroll vertical */
    overflow-x: hidden;  /* pas de scroll horizontal */
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

div.modal-category button{
    width: 25vw;
    padding: 0.8em;
    cursor: pointer;

    /* Retirer le style bouton */
    background: none;
    border: none;
    text-align: left;

    /* Aspect liste */
    border-radius: 6px;
    background-color: #ededed;
    transition: 0.2s;
}

/* Hover */
div.modal-category button:hover {
    background-color: #EAF205;
}

/* Focus (accessibilité) */
div.modal-category button:focus {
    outline: 3px solid #bcd4ff;
}


.modal-content .table-wrapper {
  flex: 1 1 auto;   /* prend tout l’espace restant */
  min-height: 0;    /* essentiel pour éviter que le scroll déborde */
  display: flex;
  flex-direction: row;
  gap: 1em;         /* espace entre filtres et tableau */
}


.modal-content div.table-scroll{
    /* max-height: 60vh; */
    flex: 1 1 auto;       /* ← prend l’espace restant */
    min-height: 0;        /* ← SUPER IMPORTANT pour éviter le débordement */
    overflow-y: auto;    /* scroll vertical */
    overflow-x: visible;  /*pas de scroll horizontal*/
}

.modal-content table.articles-table {
    width: 50vw;
}

/* sticky thead */
.modal-content div.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.modal-content table.articles-table tr{
    transition: 0.2s;
}

.modal-content table.articles-table tr:hover {
    background-color: #EAF205;
    cursor: pointer;
}

.table-wrapper table.filters{
    white-space: nowrap;
}
.table-wrapper table.filters select{
    width: 100px;
}

/*==============================================================================
                            RULES OF SIDEBAR                                                                        
==============================================================================*/
#undo-redo{
    display: flex;
    gap: 1em;
}

#undo-redo > button,
aside div.hint button{
    width: 100%;
}

#info-user{
    border-radius: 50%;
    margin: 0 auto;
    width: min-content;
    color: white;
    background-color: #2196F3;
    border: none;
}


#info-user:hover{
    transform: none;
    background-color: #1976D2; /* bleu un peu plus foncé au hover */
    opacity: 1;
}

/*==============================================================================
                            RULES OF INFO MODAL
==============================================================================*/

#modal-dimensionnement .modal-content{
    width: 70vw;
    max-height: 85vh;
    overflow-y: auto;
}

#dimensionnement-images{
    display: flex;
    flex-direction: column;
    gap: 2em;
    align-items: center;
}

#dimensionnement-images figure{
    margin: 0;
    width: 100%;
}

#dimensionnement-images img{
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#modal-info .modal-content{
    width: 50vw;
    height: 80vh;
    overflow-y: auto; 
}

#modal-confirm-save-bd .modal-content{
    width: max-content;
    height: min-content;
    overflow-y: auto; 
    text-align: center;
}

#modal-confirm-save-bd .modal-content div{
    display: flex;
    gap: 1rem;
    justify-content: center;
}

#modal-confirm-save-bd .modal-content button{
    padding: 0.75rem 1.5rem;
}