body {
    font-family: Arial, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
}

.header {
    background-color: #28a745;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    height: 40px;
    margin-right: 15px;
}

h1 {
    margin: 0;
    font-size: 1.4em;
}

.nav {
    display: flex;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    margin-right: 20px;
}

.nav-link:hover {
    text-decoration: underline;
}

.user-info {
    font-size: 0.9em;
}

.container {
    margin: 20px;
}

#searchInput {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

/* Styles fixes pour le tableau de clients */
table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    table-layout: fixed !important; /* Force le layout fixe */
}

table th, table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Définir des largeurs fixes pour chaque colonne */
table th:nth-child(1), table td:nth-child(1) { /* Nom */
    width: 15% !important;
    max-width: 15% !important;
}

table th:nth-child(2), table td:nth-child(2) { /* Adresse */
    width: 25% !important;
    max-width: 25% !important;
}

table th:nth-child(3), table td:nth-child(3) { /* Distance */
    width: 8% !important;
    max-width: 8% !important;
}

table th:nth-child(4), table td:nth-child(4) { /* Téléphone */
    width: 7% !important;
    max-width: 7% !important;
}

table th:nth-child(5), table td:nth-child(5) { /* Périodicité */
    width: 10% !important;
    max-width: 10% !important;
}

table th:nth-child(6), table td:nth-child(6) { /* Récupération */
    width: 15% !important;
    max-width: 15% !important;
}

table th:nth-child(7), table td:nth-child(7) { /* Récupérer */
    width: 10% !important;
    max-width: 10% !important;
}

table th:nth-child(8), table td:nth-child(8) { /* Actions */
    width: 10% !important;
    max-width: 10% !important;
}

/* Assurer que le contenu long est correctement coupé */
.customer-name, .customer-address {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
    margin-right: 5px;
    margin-bottom: 5px;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-recover {
    background-color: #28a745;
    color: white;
    width: 100%;
}

.btn-recover:hover {
    background-color: #218838;
}

.btn-program {
    background-color: #17a2b8;
    color: white;
    width: 100%;
}

.btn-program:hover {
    background-color: #138496;
}

.btn-edit {
    background-color: #6c757d;
    color: white;
    width: 100%;
}

.btn-edit:hover {
    background-color: #5a6268;
}

.btn-delete {
    background-color: #dc3545;
    color: white;
}

.btn-delete:hover {
    background-color: #c82333;
}

.btn-back {
    background-color: #6c757d;
    color: white;
    margin-right: 10px;
}

.btn-back:hover {
    background-color: #5a6268;
}

/* Styles pour les modals */
.modal {
    display: none;
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background: #fff;
    padding: 20px 25px;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 10px; 
    right: 15px;
    font-size: 20px;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    gap: 10px;
}

.client-info-container {
    background-color: #f8f9fa;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid #28a745;
}

/* Styles pour les alertes */
.alert {
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Styles pour mytour.php */
.late-recovery { 
    color: red; 
    font-weight: bold; 
}

.recovery-info { 
    margin-bottom: 5px; 
}

.btn-container { 
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.distance-info { 
    font-size: 0.9em; 
    color: #666; 
}

.distance-cell {
    min-width: 80px;
}

.tour-card {
    border: 1px solid #ddd;
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 5px;
    background-color: white;
}

.tour-date {
    font-weight: bold;
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #28a745;
}

.tour-info {
    display: flex;
    justify-content: space-between;
}

.tour-customer {
    flex: 2;
}

.tour-actions {
    flex: 1;
    text-align: right;
}

.tour-map {
    margin-top: 15px;
}

.map-link {
    color: #28a745;
    text-decoration: none;
}

.map-link:hover {
    text-decoration: underline;
}

/* Styles pour client_edit.php et client_create.php */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab {
    padding: 10px 15px;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    margin-bottom: -1px;
    background-color: #f8f9fa;
}

.tab.active {
    background-color: white;
    border-color: #ddd;
    border-radius: 4px 4px 0 0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.quantity-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

.quantity-label {
    width: 60px;
}

.error-message {
    color: red;
    margin-bottom: 15px;
}

#map {
    height: 400px;
    width: 100%;
    margin-top: 10px;
    border-radius: 4px;
}

/* Pour masquer la barre de recherche DataTables */
.dataTables_filter {
    display: none;
}

/* Style pour le compteur de litres et de bidons */
.container-count {
    margin-top: 5px;
    font-size: 0.9em;
    color: #666;
}

/* Zone d'actions en bas de formulaire */
.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.delete-section {
    border-top: 1px solid #eee;
    margin-top: 30px;
    padding-top: 20px;
}

.delete-section h4 {
    color: #dc3545;
    margin-bottom: 15px;
}

/* Supprimer les styles de DataTables qui causent des problèmes */
.dataTable {
    width: 100% !important;
}

.dataTables_scrollHeadInner,
.dataTables_scrollFootInner {
    width: 100% !important;
}

/* Amélioration de l'affichage sur mobile */
@media (max-width: 768px) {
    .tour-info {
        flex-direction: column;
    }
    
    .tour-actions {
        margin-top: 15px;
        text-align: left;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
    }
    
    .header-left {
        margin-bottom: 10px;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
}