.footer {
    width: 100%;
    bottom: 0;
    margin-top: 2rem;
    padding: 1rem 0;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.card {
    display: flex;
    flex-direction: column;
}
.card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.card-footer {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-top: 1rem;
}

/* Styles pour le tableau des clients */
.table th {
    white-space: nowrap;
    position: relative;
    background-color: #f8f9fa;
    color: #212529;
    font-weight: 600;
    padding: 12px 15px;
    border-bottom: 2px solid #dee2e6;
}

/* Styles spécifiques pour l'en-tête sombre */
.table-dark th {
    background-color: #343a40 !important;
    color: #fff !important;
    border-color: #454d55;
}

/* Style pour les cellules du tableau */
.table td {
    vertical-align: middle;
    text-align: center;
    padding: 10px 15px;
}

/* Styles pour les contrôles DataTables */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_paginate {
    text-align: center;
    margin: 10px 0;
    padding: 0 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

/* Positionnement du champ de recherche au-dessus de la colonne Nom */
.dataTables_wrapper .dataTables_filter {
    width: 100%;
    margin: 10px 0 30px 0;
    order: -1; /* Déplace le champ de recherche en premier */
}

.dataTables_wrapper .dataTables_filter label {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dataTables_wrapper .dataTables_filter input {
    width: 300px;
    max-width: 100%;
    margin-left: 10px;
    display: inline-block;
}

/* Ajustement pour le sélecteur du nombre d'entrées */
.dataTables_wrapper .dataTables_length {
    text-align: left;
    margin-bottom: 15px;
}

/* Styles pour la pagination en haut */
.dataTables_wrapper .top .dataTables_info,
.dataTables_wrapper .top .dataTables_paginate {
    margin-top: 10px;
}

/* Style des boutons de pagination */
.dataTables_wrapper .dataTables_paginate {
    width: 100%;
    margin: 15px 0;
    padding: 15px 0 !important;
    text-align: center;
}

.dataTables_wrapper .dataTables_paginate .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin: 10px 0 0 0 !important;
    padding: 0;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    margin: 0 2px;
    padding: 0 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    color: #0d6efd !important;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.disabled) {
    background-color: #e9ecef;
    color: #0a58ca !important;
    text-decoration: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #0d6efd;
    color: white !important;
    border-color: #0d6efd;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active {
    color: #6c757d !important;
    background: transparent;
    border-color: #dee2e6;
    cursor: default;
}

/* Ajustement pour les boutons Précédent/Suivant */
.dataTables_wrapper .dataTables_paginate .paginate_button.previous {
    padding: 0 8px 0 4px;
    margin-right: 4px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.next {
    padding: 0 4px 0 8px;
    margin-left: 4px;
}

/* Réduire l'espacement entre les éléments de pagination */
.dataTables_wrapper .dataTables_paginate .pagination {
    gap: 2px;
}

/* Ajustement spécifique pour les numéros de page */
.dataTables_wrapper .dataTables_paginate .paginate_button:not(.previous):not(.next) {
    min-width: 28px;
    margin: 0 1px;
}

/* Ajustement pour les points de suspension */
.dataTables_wrapper .dataTables_paginate .ellipsis {
    padding: 0 8px;
    color: #6c757d;
    display: inline-flex;
    align-items: center;
    height: 32px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    color: #adb5bd !important;
    background: #f8f9fa !important;
    border-color: #dee2e6;
    cursor: not-allowed;
}

/* Boutons précédent/suivant */
.dataTables_wrapper .dataTables_paginate .paginate_button.previous,
.dataTables_wrapper .dataTables_paginate .paginate_button.next {
    padding: 0 12px;
}

/* Cacher les éléments de pagination non nécessaires */
.dataTables_wrapper .dataTables_paginate .paginate_button.first,
.dataTables_wrapper .dataTables_paginate .paginate_button.last,
.dataTables_wrapper .dataTables_paginate .ellipsis {
    display: none;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    font-size: 0.9em;
    white-space: nowrap;
}

.dataTables_wrapper .dataTables_length select {
    width: auto;
    min-width: 70px;
    padding: 4px 8px;
    margin: 0 5px;
    display: inline-block;
    vertical-align: middle;
}

.dataTables_wrapper .dataTables_filter input {
    margin: 0;
    padding: 4px 8px;
    width: 180px;
    display: inline-block;
    font-size: 0.9em;
    border: 1px solid #ced4da;
    border-radius: 4px;
    vertical-align: middle;
}

/* Centrer le contenu des cellules d'en-tête */
.table th {
    text-align: center;
}

/* S'assurer que les boutons dans les cellules sont bien centrés */
.table td .btn-group, 
.table td .btn {
    display: flex;
    justify-content: center;
    margin: 0 auto;
}

/* Centrer les badges dans les cellules */
.table td .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

/* Style pour les boutons d'action dans le tableau */
.table td .actions-container,
.table td .btn-group {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 120px;
    padding: 4px 0;
}

/* Style de base pour les boutons d'action dans les cellules du tableau */
.table td .btn:not(.paginate_button):not(.btn-link):not(.dropdown-item) {
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background-color: white;
    color: #6c757d;
    transition: all 0.2s ease-in-out;
}

/* Style au survol des boutons */
.table td .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Couleurs spécifiques pour chaque type de bouton */
.table td .btn-info {
    color: #0dcaf0;
    border-color: #0dcaf0;
}

.table td .btn-warning {
    color: #ffc107;
    border-color: #ffc107;
}

.table td .btn-danger {
    color: #dc3545;
    border-color: #dc3545;
}

/* Style pour les icônes */
.table td .btn i {
    font-size: 1.1rem;
    color: inherit !important; /* Forcer l'héritage de la couleur */
}

/* Couleurs spécifiques pour chaque type de bouton */
.table td .btn-info,
.table td .btn-info i {
    color: #0dcaf0 !important;
    border-color: #0dcaf0 !important;
}

.table td .btn-warning,
.table td .btn-warning i {
    color: #ffc107 !important;
    border-color: #ffc107 !important;
}

.table td .btn-danger,
.table td .btn-danger i {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
}

/* S'assurer que les icônes héritent de la couleur du bouton */
.table td .btn i.fas,
.table td .btn i.far,
.table td .btn i.fab {
    color: inherit !important;
}

/* Réinitialisation des styles pour les boutons de pagination et autres contrôles DataTables */
.dataTables_wrapper .dataTables_paginate .paginate_button,
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    width: auto;
    height: auto;
    min-width: auto;
    padding: 0.375rem 0.75rem;
    margin: 0;
    display: inline-block;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Style pour le champ de recherche */
.dataTables_wrapper .dataTables_filter input {
    width: 250px;
    margin-left: 10px;
}

/* Style pour le sélecteur du nombre d'entrées */
.dataTables_wrapper .dataTables_length select {
    padding: 0.25rem 1.75rem 0.25rem 0.5rem;
    margin: 0 5px;
}

/* Largeur fixe pour la colonne Nom */
table.dataTable thead th:nth-child(1),
table.dataTable tbody td:nth-child(1) {
    width: 200px;
    max-width: 200px;
    min-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Empêcher le défilement horizontal */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    padding: 0 15px;
}

#clientsTable {
    width: 100% !important;
    table-layout: auto;
    margin: 0;
}

/* Ajustement des colonnes pour s'adapter à la largeur */
#clientsTable thead th,
#clientsTable tbody td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Ajustement spécifique pour la colonne des actions */
#clientsTable .actions-container {
    min-width: 120px;
}

/* Styles pour les colonnes spécifiques */
.col-telephone {
    width: 100px;
    max-width: 100px;
}

.col-commentaire {
    width: 200px;
    max-width: 200px;
    white-space: normal;
    word-wrap: break-word;
}

/* Style pour les boutons dans les cellules */
.table td .btn {
    margin: 0 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Style pour les lignes du tableau */
.table tbody tr {
    transition: background-color 0.2s;
}

.table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.table th.sorting:after,
.table th.sorting_asc:after,
.table th.sorting_desc:after {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.badge {
    font-size: 0.85em;
    padding: 0.4em 0.6em;
    font-weight: 500;
}

.btn-group .btn {
    margin: 0 2px;
}

/* Styles pour les modales */
.modal-header.bg-primary {
    color: white;
}

/* Styles pour la page robots */
#loading-overlay {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 30px 50px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    z-index: 1050;
    text-align: center;
    max-width: 90%;
}

#loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
}

#loading-overlay p {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.updating {
    opacity: 0.7;
    pointer-events: none;
}

#last-update {
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

#last-update-time {
    font-weight: 500;
    color: #0d6efd;
}

/* Amélioration des boutons d'action */
.btn-action {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    margin: 0 2px;
}

/* Style pour les badges d'état */
.badge.bg-success {
    background-color: #198754 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
}

/* Amélioration du tableau */
#clientsTable {
    margin-top: 1rem;
    width: 100% !important;
    table-layout: auto;
    margin: 0;
    padding: 0;
}

/* Réinitialisation des styles par défaut */
#clientsTable th,
#clientsTable td {
    white-space: nowrap;
    vertical-align: middle;
    padding: 8px 12px;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Largeurs des colonnes */
#clientsTable th:nth-child(1), 
#clientsTable td:nth-child(1) { 
    width: auto;
    min-width: 150px;
    max-width: 200px;
} /* Nom du client */

#clientsTable th:nth-child(2), 
#clientsTable td:nth-child(2) { 
    width: auto;
    min-width: 100px;
    max-width: 120px;
} /* Type machine */

#clientsTable th:nth-child(3), 
#clientsTable td:nth-child(3) { 
    width: auto;
    min-width: 100px;
    max-width: 150px;
} /* Version Passerelle */

#clientsTable th:nth-child(4), 
#clientsTable td:nth-child(4) { 
    width: auto;
    min-width: 140px;
    max-width: 160px;
} /* Dernière Remontée */

#clientsTable th:nth-child(5), 
#clientsTable td:nth-child(5) { 
    width: auto;
    min-width: 160px;
    max-width: 180px;
} /* Dernière Vérification */

#clientsTable th:nth-child(6), 
#clientsTable td:nth-child(6) { 
    width: auto;
    min-width: 80px;
    max-width: 100px;
    text-align: center;
} /* Statut */

#clientsTable th:nth-child(7),
#clientsTable td:nth-child(7) { 
    width: auto;
    min-width: 200px;
    max-width: 300px;
    white-space: normal !important;
    overflow: visible;
    text-overflow: clip;
} /* Commentaire */

#clientsTable th:nth-child(8),
#clientsTable td:nth-child(8) { 
    width: auto;
    min-width: 100px;
    max-width: 120px;
    text-align: center;
} /* Actions */

/* Conteneur du tableau */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    padding: 0;
}

/* Style pour les cellules d'en-tête */
#clientsTable thead th {
    background-color: #343a40;
    color: white;
    font-weight: 500;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Style pour les lignes du tableau */
#clientsTable tbody tr {
    transition: background-color 0.2s;
}

#clientsTable tbody tr:hover {
    background-color: #f8f9fa;
}

/* Style pour les boutons d'action */
#clientsTable .btn {
    margin: 0 2px;
    padding: 0.25rem 0.5rem;
}

#clientsTable td {
    vertical-align: middle;
}

/* Style pour les lignes du tableau */
#clientsTable tbody tr:hover {
    background-color: #f8f9fa;
}

/* Style pour les boutons d'action dans le tableau */
#clientsTable .btn {
    margin: 0 2px;
}

/* Styles spécifiques pour les boutons d'accès distant */
#clientsTable .btn-success {
    background-color: #198754;
    border-color: #198754;
    color: white !important;
}

#clientsTable .btn-success:hover {
    background-color: #157347;
    border-color: #146c43;
}

#clientsTable .btn-outline-secondary {
    color: #6c757d !important;
    border-color: #dee2e6;
}

#clientsTable .btn-outline-secondary:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

/* Style pour le header du tableau */
#clientsTable thead th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Styles pour les formulaires */
.form-label {
    font-weight: 500;
}

/* Styles pour les cartes d'en-tête */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Styles pour les boutons d'action */
.btn-sm i {
    font-size: 0.9em;
}

/* Styles pour les messages d'erreur */
.invalid-feedback {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}

/* Styles pour les champs de formulaire invalides */
.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Styles pour les sélecteurs de date */
.flatpickr-input {
    background-color: white;
}

/* Styles pour les boutons de bas de formulaire */
.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}