/* -------------------------------------------------------------------------- */
/*                                CSS Personnalisé                            */
/* -------------------------------------------------------------------------- */

.calendar .calendar-day {
    padding: 0.75rem;
}

.data-table thead th {
    cursor: pointer;
}

.text-pink {
    color: #d63384;
}

.bg-pink {
    background-color: #d63384;
}

[data-bs-theme=dark] input[readonly]:not(input[type="hidden"].flatpickr-input + input[readonly]) {
    background-color: #343a40 !important;
    color: #fff !important;
}

[data-bs-theme=light] input[readonly]:not(input[type="hidden"].flatpickr-input + input[readonly]) {
    background-color: #e4e4e4 !important;
    color: #000 !important;
}

.card .card-download-btn {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
}

.card:hover > .card-download-btn {
    display: block;
}

/** Permet d'enlever la petite flèche du dropdown */
#add-row-button::after {
    display: none;
}

.column-grid-link {
    border: none;
}

.column-grid-link:hover .grid-bg {
    background-color: rgb(146, 241, 68) !important;
    color: #000000;
    transition: background-color 1s ease;
}

.row-control-buttons {
    top: 10px; /* Ajuster selon la marge supérieure désirée */
    bottom: 10px; /* Ajuster selon la marge inférieure désirée */
    left: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    height: calc(
        100% - 20px
    ); /* Ajuster si nécessaire pour la hauteur totale de la rangée */
}

.row-control-buttons a {
    font-size: 16px; /* Ajuster selon la taille désirée des icônes */
    display: flex;
}

.cursor-move {
    cursor: move !important;
}

.cursor-help {
    cursor: help !important;
}

.cursor-interdit {
    cursor: not-allowed !important;
}

disabled:hover {
    cursor: not-allowed !important;
}

div.dataTables_wrapper div.dataTables_paginate ul.pagination {
    justify-content: start !important;
}

.text-truncate {
    max-width: 250px; /* Ajustez selon vos besoins */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.widget-row {
    position: relative;
    padding-left: 30px; /* Espace pour le panneau de contrôle de rangée, ajuster selon le besoin */
}

.alert-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999; /* Assure que le message reste au-dessus des autres éléments */
    background-color: #f8d7da; /* Couleur de fond pour alert-danger de Bootstrap */
    color: #721c24; /* Couleur de texte pour alert-danger de Bootstrap */
    border-color: #f5c6cb; /* Bordure pour alert-danger de Bootstrap */
    padding: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5); /* Optionnel: Ajoute une ombre pour mieux voir l'alerte */
}

.CodeMirror {
    height: auto;
    min-height: 100px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.sql-toolbar {
    margin: 10px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.blocnote {
    background-color: #fff8bb;
    color: #000000;
}

.blocnote:focus {
    background-color: #fff8bb;
    color: #000000;
}

.nbNotifSuperieur100 {
    font-size: 0.5rem;
}

.nbNotifSuperieur999 {
    font-size: 0.40rem;
}

fieldset legend {
    color: #2362b7;
    width: auto;
}

fieldset {
    border: 1px solid #2362b7;
    padding: 10px;
}

.dropzone:hover {
    border: 2px dashed #0056b3 !important;
}

.dropzone {
    background: none !important;
}

.dropzone .dz-preview.dz-image-preview {
    background: none !important;
}

.excalidraw .dropdown-menu{
    display: unset !important;
    padding: unset !important;
}

#tableaublanc-container section {
    padding: 0 !important;
}

.custom-no-result-picker {
    background-color: #dadada !important;
    color: #dc3545 !important;
    padding: 10px !important;
    font-weight: bold !important;
    text-align: center !important;
    border: 1px solid #dc3545 !important;
    border-radius: 4px !important;
}

.bootstrap-select .no-results {
    background: #f5f5f5 !important;
    color: #dc3545 !important;
    padding: 10px !important;
    margin: 0 5px !important;
    border-radius: 4px !important;
    font-weight: bold !important;
    font-size: 14px !important;
}

table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control::before {
    top: 50% !important;
    left: 5px !important;
    height: 1em !important;
    width: 1em !important;
    margin-top: -9px !important;
    display: inline-block !important;
    color: white !important;
    border: .15em solid white !important;
    border-radius: 1em !important;
    box-shadow: 0 0 .2em #444 !important;
    box-sizing: content-box !important;
    text-align: center !important;
    text-indent: 0 !important;
    font-family: "Courier New", Courier, monospace !important;
    line-height: 1em !important;
    content: "+" !important;
    background-color: #31b131 !important;
}

table.dataTable.dtr-inline.collapsed>tbody>tr.dtr-expanded>td.dtr-control:before,
table.dataTable.dtr-inline.collapsed>tbody>tr.dtr-expanded>th.dtr-control:before{
    top: 50% !important;
    left: 5px !important;
    height: 1em !important;
    width: 1em !important;
    margin-top: -9px !important;
    display: inline-block !important;
    color: white !important;
    border: .15em solid white !important;
    border-radius: 1em !important;
    box-shadow: 0 0 .2em #444 !important;
    box-sizing: content-box !important;
    text-align: center !important;
    text-indent: 0 !important;
    font-family: "Courier New", Courier, monospace !important;
    line-height: 1em !important;
    content: "-" !important;
    background-color: #d33333 !important;
}

fieldset:hover {
    background-color: rgba(13, 110, 253, 0.02);
}

fieldset:hover legend {
    font-weight: 600;
}

.bootstrap-select>.dropdown-toggle {
    border: 1px solid #cbd0dd;
}

.card-header[data-fermable="true"] {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.card-header[data-fermable="true"]:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.card-header[data-fermable="true"] i {
    transition: transform 0.3s ease;
}

.card-header[data-fermable="true"] i.fa-minus {
    transform: rotate(180deg);
}

/** Couleur pour les jours fermés, weekend et jour férie et couleur de base */
.jour_weekend {
    background: repeating-linear-gradient(45deg,#502e1a,#502e1a 10px,#442517 10px,#442517 20px);
}

.jour_ferie {
    background: repeating-linear-gradient(45deg,#8b2b9d,#8b2b9d 10px,#7030a0 10px,#7030a0 20px);
}

.jour_ferme {
    background: repeating-linear-gradient(45deg,#fd3100,#fd3100 10px,#ff0000 10px,#ff0000 20px);
}

.jour_base {
    background: repeating-linear-gradient(45deg,#d9d9d9,#d9d9d9 10px,#d9d9d9 10px,#d9d9d9 20px);
}

div.dropdown-menu.open { width: 100%; } ul.dropdown-menu.inner>li>a { white-space: initial; }

@media screen and (max-width: 767px) {
    .table-cards thead { 
        display: none; 
    }
    
    .table-cards,
    .table-cards tbody,
    .table-cards tr {
        display: block;
        width: 100%;
    }
    
    .table-cards tr {
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.5rem;
        padding: 1rem;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        max-width: 100%;
        overflow: hidden;
        position: relative;
    }
    
    /* Styles pour le titre de la card */
    .table-cards .card-title {
        font-weight: bold;
        font-size: 1.1em;
        margin: -1rem -1rem 1rem -1rem;
        padding: 1rem;
        background: #f8f9fa;
        border-bottom: 1px solid #dee2e6;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .table-cards .toggle-icon {
        transition: transform 0.3s ease;
        display: inline-block;
    }

    /* Content container pour l'animation */
    .table-cards .card-content {
        transition: max-height 0.3s ease-out;
        overflow: hidden;
        max-height: 2000px;
    }

    .table-cards tr.collapsed .card-content {
        max-height: 0;
        overflow: hidden;
    }
    
    .table-cards td {
        display: flex;
        padding: 0.25rem 0;
        border: none !important;
        align-items: flex-start;
        min-width: 0;
        text-align: left !important;
        padding-left: 0 !important;
        /* Ajout de ces propriétés */
        flex-wrap: wrap;
        gap: 0.5rem; /* Espace entre les éléments */
    }
    
    .table-cards td::before {
        content: attr(data-label);
        font-weight: bold;
        color: rgb(117, 117, 117);
        width: 140px;
        min-width: 140px;
        flex-shrink: 0;
        padding-right: 1rem;
        text-align: left;
    }
    
    .table-cards td .td-content {
        flex: 1;
        min-width: 0;
        overflow: auto;
        text-overflow: unset;
        word-wrap: break-word;
        text-align: left !important;
    }

    .table-cards .td-content:has(button) {
        overflow: visible;
    }
    
    .table-cards .actions-cell {
        justify-content: flex-end;
        padding-top: 1rem;
        margin-top: 0.5rem;
        border-top: 1px solid #dee2e6 !important;
    }
    
    .table-cards .actions-cell::before {
        display: none;
    }

    .table-cards tfoot {
        display: block;
        width: 100%;
        margin-top: 1rem;
    }

    .table-cards tfoot tr {
        background-color: #f8f9fa;
        padding: 0.5rem; /* Ajout d'un peu de padding */
    }

    .table-cards tfoot td::before {
        content: attr(data-label);
        font-weight: bold;
        color: rgb(117, 117, 117);
        width: 185px;
        min-width: 185px;
        flex-shrink: 0;
        padding-right: 1rem;
        text-align: left !important;
        white-space: nowrap; /* Empêche le retour à la ligne */
        overflow: hidden; /* Au cas où */
        text-overflow: ellipsis; /* Au cas où */
    }

    .table-cards tfoot td {
        display: flex;
        padding: 0.05rem 0.05rem; /* Ajout de padding horizontal */
        border: none !important;
        align-items: center; /* Changed from flex-start */
        min-width: 0;
        gap: 0.5rem; /* Ajoute un espacement entre label et contenu */
    }

    .table-cards tfoot td .td-content {
        flex: 1;
        min-width: 0;
        font-weight: bold;
        color: #000;
        text-align: right !important; /* Aligne les valeurs à droite */
    }

    /* Cache les cellules sans data-label dans le tfoot */
    .table-cards tfoot td:not([data-label]) {
        display: none;
    }

    /* Assure que seules les cellules avec data-label sont visibles */
    .table-cards tfoot td[data-label] {
        display: flex;
        margin: 0; /* Reset des marges */
    }
}

.border-right-black {
    border-right: 1px solid #4e4e4e;
}

/* Styles personnalisés */
.entete-salarie {
    background-color: #f8f9fa;
}

.color-pink {
    color: rgb(255, 155, 202) !important;
}
.color-primary {
    color: rgb(152, 202, 255) !important;
}
.color-warning {
    color: rgb(252, 199, 156) !important;
}
.color-secondary {
    color: #6c757d !important;
}

.border-pink {
    border-left: 4px solid rgb(255, 155, 202) !important;
}

.border-primary {
    border-left: 4px solid rgb(152, 202, 255) !important;
}

.border-warning {
    border-left: 4px solid rgb(252, 199, 156) !important;
}

.border-secondary {
    border-left: 4px solid #6c757d !important;
}

.fond-primary {
    background-color: rgb(152, 202, 255) !important;
}

.fond-warning {
    background-color: rgb(252, 199, 156) !important;
}

.fond-pink {
    background-color: rgb(255, 155, 202) !important;
}

.fond-secondary {
    background-color: #6c757d !important;
}

.entete-mois {
    background-color: #e9ecef;
    font-weight: bold;
    /* cursor: pointer; */
}

.taux-item {
    transition: background-color 0.2s;
}
.taux-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}
.transition-hover {
    transition: all 0.2s ease-in-out;
}

.ligne-periode:hover {
    background-color: #f1f8ff;
}

.border-grey {
    border: 1px solid #748194;
}

.total-mois {
    background-color: #f2f2f2;
    font-weight: bold;
}

.total-annuel {
    background-color: #e7f5ff;
    font-weight: bold;
}

.valeur-negative {
    color: #dc3545;
}

.valeur-positive {
    color: #198754;
}


/* Fix table head */
.tableFixHead { overflow: auto; height: 500px; }
.tableFixHead thead th { position: sticky; top: 0; z-index: 1; }

/* Just common table stuff. Really. */
.tableFixHead table { border-collapse: collapse; width: 100%; }
.tableFixHead th { background:#FFFFFF; }

.tableFixHead {
    overflow: auto;
    height: 500px;
}

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

.tableFixHead thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.tableFixHead th {
    background: #FFFFFF;
}

/* Ajoutez ceci pour gérer les rowspans */
.tableFixHead thead tr:nth-child(1) th {
    position: sticky;
    top: 0;
}

.tableFixHead thead tr:nth-child(2) th {
    position: sticky;
    top: 30px; /* Ajustez cette valeur en fonction de la hauteur de votre première ligne d'en-tête */
}

/* Styles pour l'impression - format paysage */
@media print {
    @page {
        size: A4 landscape;
        margin: 1cm;
    }
    
    /* IMPORTANT : Forcer l'impression des couleurs */
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    /* CORRECTION: Masquer seulement certains éléments, pas tout */
    body > *:not(.impression-mensuelle) {
        display: none !important;
    }
    
    /* S'assurer que la zone d'impression est visible */
    .impression-mensuelle {
        display: block !important;
        visibility: visible !important;
        position: static !important;
        width: 100% !important;
        height: auto !important;
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .impression-mensuelle * {
        visibility: visible !important;
    }
    
    /* Titre d'impression */
    .impression-mensuelle .titre-impression {
        display: block !important;
        text-align: center;
        font-size: 18px !important;
        font-weight: bold;
        margin: 20px 0 !important;
        padding: 0 !important;
        page-break-after: avoid;
        color: black !important;
    }
    
    /* Styles spécifiques pour le tableau d'impression */
    .impression-mensuelle table {
        display: table !important;
        width: 100% !important;
        font-size: 8px !important;
        border-collapse: collapse !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
    }
    
    .impression-mensuelle th,
    .impression-mensuelle td {
        display: table-cell !important;
        border: 1px solid #000 !important;
        padding: 2px 3px !important;
        text-align: center !important;
        page-break-inside: avoid;
        font-size: 8px !important;
        line-height: 1.2 !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        visibility: visible !important;
    }
    
    .impression-mensuelle thead {
        display: table-header-group !important;
        position: static !important;
        background: #f8f9fa !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    .impression-mensuelle tbody {
        display: table-row-group !important;
    }
    
    .impression-mensuelle tr {
        display: table-row !important;
        page-break-inside: avoid;
    }
    
    .impression-mensuelle th {
        background: #e9ecef !important;
        font-weight: bold !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    /** Couleurs pour les jours - VERSION SIMPLIFIÉE POUR IMPRESSION */
    .impression-mensuelle .jour_weekend {
        background-color: #8B4513 !important;
        color: white !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    .impression-mensuelle .jour_ferie {
        background-color: #8b2b9d !important;
        color: white !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    .impression-mensuelle .jour_ferme {
        background-color: #fd3100 !important;
        color: white !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    .impression-mensuelle .jour_base {
        background-color: #d9d9d9 !important;
        color: black !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    /* Masquer les éléments non nécessaires */
    .no-print {
        display: none !important;
    }
    
    /* S'assurer que les boutons et menus n'apparaissent pas */
    button, .btn, nav, header, footer, .sidebar {
        display: none !important;
    }
}

/* Styles pour l'écran normal - INCHANGÉS */
.tableau-wrapper {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

.tableau-wrapper thead th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 10;
}