/* Styles du module Pré-commandes */


/* Forcer un layout fixe pour que les width de colonnes soient respectés */
table#precomm_table {
    table-layout: fixed;
    width: 100%; /* ou une autre valeur adaptée */
}

/* 1e colonne de toutes les lignes (ref) */
table#precomm_table td:nth-child(1),
table#precomm_table th:nth-child(1) {
    width: 80px;           /* largeur forcée */
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Pour tronquer certaines référence exotiques */
}

/* 2e colonne de toutes les lignes (nom) */
table#precomm_table td:nth-child(2),
table#precomm_table th:nth-child(2) {
    min-width: 250px;
    /*background-color: #f5f5f5;*/
}
/* 3e colonne de toutes les lignes (fournisseur) */
table#precomm_table td:nth-child(3),
table#precomm_table th:nth-child(3) {
    min-width: 150px;
}
/* 5e colonne de toutes les lignes (stock) */
table#precomm_table td:nth-child(5),
table#precomm_table th:nth-child(5) {
    max-width: 20px;  
}

.butAction.precommandes {
    margin-left: 0px;
    padding-left: px;
}


.butAction.bascule_ouvert {
   
    background: rgba(0, 40, 255, 0.65);    
    border-color: rgba(15, 0, 195, 0.4);
}

.butAction.bascule_ferme {
   
    background: rgba(93, 90, 90, 0.65);    
    border-color: rgba(85, 85, 85, 0.4);
}


/* UI édition produits (V1 + récurrentes) - facilement paramétrable */
:root {
    --precomm-row-active-bg: #e7f3ff;
    --precomm-pill-yes-bg: #28a745;
    --precomm-pill-no-bg: #6c757d;
    --precomm-action-add-bg: #28a745;
    --precomm-action-remove-bg: #dc3545;
    --precomm-action-primary-bg: #007bff;
}

tr.precomm-row-active > td {
    background: var(--precomm-row-active-bg) !important;
}

.precomm-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.2;
    color: #fff;
    white-space: nowrap;
    border: 0;
}
.precomm-pill-yes { background: var(--precomm-pill-yes-bg); }
.precomm-pill-no  { background: var(--precomm-pill-no-bg); }

.precomm-action-btn {
    font-size: 11px;
    padding: 2px 8px;
    line-height: 1.25;
    white-space: nowrap;
    cursor: pointer;
    border: 0;
    border-radius: 3px;
    color: #fff !important;
    text-shadow: none;
    opacity: 1;
}

/* Empêche les thèmes Dolibarr/DataTables de masquer le texte hors hover */
.precomm-action-btn:hover,
.precomm-action-btn:focus,
.precomm-action-btn:active,
.precomm-action-btn:visited {
    color: #fff !important;
    text-decoration: none !important;
}

.precomm-action-add { background-color: var(--precomm-action-add-bg) !important; }
.precomm-action-remove { background-color: var(--precomm-action-remove-bg) !important; }
.precomm-action-primary { background-color: var(--precomm-action-primary-bg) !important; }


/* ============================================================================
   STYLES POUR LA PAGE RESULTATS PRECOMMANDES PAR CLIENT
   (resultats_precommandes_client.php)
   
   Page affichant les commandes par client, groupées par semaine de retrait.
   Permet de marquer les produits comme retirés via checkbox AJAX.
   ============================================================================ */

/* --- Sélecteur de semaine --- */
.week-selector {
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 5px;
}

.week-selector select {
    padding: 8px 12px;
    font-size: 14px;
    min-width: 400px;
}

.week-info {
    margin-top: 10px;
    font-style: italic;
    color: #666;
}

/* --- Tableau principal des commandes par client --- */
table.commandes-client {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table.commandes-client th,
table.commandes-client td {
    border: 1px solid #ccc;
    padding: 10px 8px;
    text-align: left;
}

/* En-têtes de colonnes */
table.commandes-client th {
    background: #e0e0e0;
    font-weight: bold;
}

/* Ligne marquée comme retirée */
table.commandes-client tr.retrait {
    background: #e8e8e8;
    color: #888;
}

/* Effet survol sur les lignes */
table.commandes-client tr:hover {
    background: #f0f0f0;
}

table.commandes-client tr.retrait:hover {
    background: #ddd;
}

/* Checkbox retrait */
.checkbox-retrait {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* --- En-tête de groupe client --- 
   Affiché à chaque changement de client dans la liste */
.group-header {
    /* background: #b5c9fb !important;*/
    background: #708abd !important; 
    color: #242424;
    font-weight: bold;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    /* border-left: 4px solid #85c1e9;*/
}

/* --- Séparateur entre groupes de clients ---
   Espace visuel entre chaque bloc client */
.client-separator td {
    height: 20px;
    border: none !important;
    background: transparent !important;
}

/* --- Sous-en-tête de date de distribution ---
   Affiché à chaque changement de date de retrait */
.subgroup-header {
    background: #bfd1ff !important;
    font-weight: bold;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

/* --- Nom de la pré-commande (affiché en italique/gris) --- */
.precommande-name {
    color: #888;
    font-size: 0.85em;
    font-style: italic;
    margin-left: 8px;
}
