/*
 * ========================================================
 * [ÉTAT : FINAL] Date : 22-05-2026 07:15:00
 * FICHIER : commandes.css
 * RÔLE : Styles pour le tableau de bord des commandes et bandes de couleurs
 * Auteurs : Yvan Dubé & Gemini (IA Collaboratrice)
 * =========================================================
 */

/* HEADER COLLANT ET CONTRÔLES */
#sticky-header-commandes {
    position: sticky;
    top: 90px;
    z-index: 1000;
    background-color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

#banniere_bas {
    padding: 15px 0;
    text-align: center;
    border-bottom: 1px solid var(--couleur-bordure, #ccc);
}

.titre-commande-print {
    margin: 0; 
    padding-top: 5px; 
    color: #444;
}

.grid_banniere_bas {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 30px;
    background-color: var(--couleur-grise-pale, #f4f4f4);
    border-bottom: 2px solid var(--couleur-bordure, #ccc);
}

.form-controle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.form-sans-marge {
    margin: 0;
    padding: 0;
}

.label-bold {
    font-weight: bold;
    color: #444;
}

.form-controle select {
    padding: 8px 12px;
    border: 1px solid var(--couleur-bordure, #ccc);
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.totaux-banniere {
    margin-left: auto; 
    margin-right: 15px; 
    padding: 6px 12px; 
    border: 1px solid var(--couleur-primaire, #7b1c8d); 
    border-radius: 4px; 
    background-color: #fff; 
    font-size: 0.95em; 
    align-self: center; 
    white-space: nowrap; 
    display: flex; 
    align-items: center;
}

.texte-succes { color: var(--couleur-succes, #27ae60); }
.texte-avertissement { color: #e67e22; }
.texte-date { font-size: 0.9em; color: #444; font-weight: 500; }
.texte-vide { color: #bbb; }
.texte-grand { font-size: 1.1em; }
.texte-tres-grand { font-size: 1.2em; }
.m-auto-left { margin-left: auto; }
.btn-imprimer { align-self: center; }

/* GRILLE D'AFFICHAGE */
.grid-container-cmd, .grid-item-cmd {
    display: grid;
    grid-template-columns: 80px 60px 1fr 100px 100px 120px 100px 140px;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.grid-container-cmd > div, .grid-item-cmd > div {
    white-space: normal;
    word-wrap: break-word;
    padding: 12px 10px;
}

.entete-mauve {
    background-color: var(--couleur-primaire, #7b1c8d) !important;
    color: white;
    font-weight: bold;
    border-bottom: 2px solid #444;
}

.entete-mauve > div {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    border-right: 1px solid rgba(255,255,255,0.1);
    padding: 0 10px;
}

.scrollable-commandes {
    max-height: 65vh;
    overflow-y: auto;
    scrollbar-gutter: stable;
    position: relative;
}

.grid-item-cmd {
    background-color: white;
    border-bottom: 1px solid var(--couleur-bordure, #ccc);
    transition: background-color 0.2s;
}

.grid-item-cmd:nth-of-type(even) { background-color: #fcfaff; }
.grid-item-cmd:hover { background-color: #f4e8f9 !important; }

/* BANDES DE COULEURS (ÉTATS) */
.ligne-bande {
    border-left: 8px solid transparent; 
}

.bande-jaune { border-left-color: #f1c40f !important; }        
.bande-orange { border-left-color: #e67e22 !important; }       
.bande-vert {
    background-color: #f0fff4 !important;
    border-left: 8px solid var(--couleur-succes, #27ae60) !important;
}
.bande-lavande { border-left-color: #c39bd3 !important; }      

select.bande-jaune { background-color: #fcf3cf; border-color: #f1c40f; }
select.bande-orange { background-color: #fae5d3; border-color: #e67e22; }
select.bande-vert { background-color: #d5f5e3; border-color: #27ae60; }
select.bande-lavande { background-color: #f4ecf7; border-color: #c39bd3; }

/* UTILITAIRES ET BOUTONS */
.col-center { text-align: center !important; justify-content: center !important; display: flex; }
.col-right { text-align: right !important; justify-content: flex-end !important; display: flex; padding-right: 20px !important; }
.font-bold { font-weight: bold; }

.img-produit-mini { 
    width: 50px; 
    height: 50px; 
    object-fit: cover; 
    border-radius: 4px; 
    border: 1px solid #ddd;
}

.badge-cat {
    background-color: var(--couleur-grise-pale, #f4f4f4);
    border: 1px solid var(--couleur-bordure, #ccc);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    color: #555;
}

.btn-navy  { background-color: navy !important; color: white !important; border: 1px solid navy !important; padding: 8px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; transition: 0.2s; }
.btn-navy:hover { background-color: #000050 !important; }

.form-reception { display: flex; gap: 5px; align-items: center; justify-content: center; margin: 0; }
.input-qte-recue { width: 45px; height: 30px; text-align: center; border: 2px solid var(--couleur-bordure, #ccc); border-radius: 4px; font-weight: bold;}
.btn-recevoir { background-color: var(--couleur-succes, #27ae60); color: white; border: none; padding: 5px 8px; border-radius: 4px; cursor: pointer; font-weight: bold; }
.btn-recevoir:hover { opacity: 0.85; }
.btn-recevoir-tout { background-color: var(--couleur-succes, #27ae60); color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-weight: bold; margin-left: 15px; }
.btn-recevoir-tout:hover { opacity: 0.85; }
.btn-annuler-reception { background: none; border: none; cursor: pointer; font-size: 1.2em; margin-left: 8px; transition: transform 0.2s; }
.btn-annuler-reception:hover { transform: scale(1.15); }
.action-cell { display: flex; align-items: center; justify-content: center; gap: 5px; }
.icone-action { font-size: 1.2em; font-weight: bold; }

/* Classe utilitaire globale pour cacher des éléments à l'écran */
.only_print { display: none !important; }

/* RÈGLES D'IMPRESSION STRICTES */
@media print {
    #container-top, #sticky-header-commandes .grid_banniere_bas, .no_print { 
        display: none !important; 
    }
    
    .only_print { display: block !important; }
    .grid-item-cmd.only_print { display: grid !important; }
    
    body { 
        background: white !important; 
        margin: 0 !important; 
        color: black !important;
    }
    
    #sticky-header-commandes { 
        position: static !important; 
        box-shadow: none !important; 
    }
    
    .scrollable-commandes { 
        max-height: none !important; 
        overflow: visible !important; 
    }

    .grid-container-cmd, .grid-item-cmd { 
        display: grid !important;
        grid-template-columns: 80px 1fr 100px 100px 120px 100px !important; 
        border: none !important;
        border-bottom: 1px solid #ccc !important;
        width: 100% !important;
        page-break-inside: avoid;
    }

    .grid-container-cmd > div:nth-child(2), .grid-item-cmd > div:nth-child(2),
    .grid-container-cmd > div:nth-child(8), .grid-item-cmd > div:nth-child(8) {
        display: none !important;
    }

    .entete-mauve {
        background-color: transparent !important;
        color: black !important;
        border-bottom: 2px solid black !important;
        border-top: 2px solid black !important;
    }
    
    .entete-mauve > div {
        border-right: none !important;
        height: auto !important;
        padding: 5px !important;
    }
    
    .ligne-bande {
        border-left: none !important;
        background-color: transparent !important;
    }

    .ligne-totaux-print {
        border-top: 2px solid #000 !important; 
        border-bottom: none !important;
    }
}

/* CELLULE DESCRIPTION ET BADGES */
.description-cell {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.titre-ligne {
    font-weight: normal;
    color: inherit;
}

.badges-container-cmd {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    font-size: 0.85em;
}

.badge-status {
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

.badge-syda { 
    color: var(--couleur-primaire, #7b1c8d); 
    background-color: #fdf7ff; 
    border: 1px solid var(--couleur-primaire, #7b1c8d); 
}

.badge-reservation {
    color: black; 
    background-color: #ebf5fb; 
    border: 1px solid black; 
}

.badge-a-commander { 
    color: #d35400; 
    background-color: #fdf2e9; 
    border: 1px solid #e67e22; 
}

/* ÉTAPE "PAYÉ" (Watermark / Filigrane) */
.watermark-paye {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-25deg);
    font-size: clamp(4rem, 8vw, 10rem); 
    font-weight: 900;
    border-radius: 20px;
    padding: 20px 40px;
    pointer-events: none; 
    z-index: 1000;
    text-transform: uppercase;
    letter-spacing: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.05);
}

.watermark-paye.only_print {
    color: rgba(0,0,0,0.3);
    border-color: rgba(0,0,0,0.3);
}

.watermark-paye:not(.only_print) {
    color: rgba(123, 28, 141, 0.12);
    border: 8px solid rgba(123, 28, 141, 0.12);
}