/* =====================================================================
 * [ÉTAT : FINAL Date : 21-05-2026 07:03:21
 * FICHIER : gestion_inventaire.css
 * RÔLE : Styles pour l'affichage et la gestion de la grille d'inventaire
 * Auteurs : Yvan Dubé & Gemini (IA Collaboratrice)
 * =====================================================================
 */

/* ==========================================================================
   1. STRUCTURE STICKY (ENTÊTE FIXE)
   ========================================================================== */
#sticky-header {
    position: sticky;
    top: 90px; /* Ajusté pour s'accrocher sous la bannière universelle */
    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);
}

.grid_banniere_bas {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--couleur-grise-pale);
}

/* ==========================================================================
   2. GRILLE D'INVENTAIRE (12 COLONNES)
   ========================================================================== */
.grid-container-inventaire, 
.grid-container-content {
    display: grid;
    grid-template-columns: 75px 180px 2.5fr 80px 70px 90px 90px 90px 60px 1.2fr 100px 110px;
    width: 100%;
}

/* Style de l'en-tête mauve */
.entete-mauve {
    background-color: var(--couleur-primaire) !important;
    color: white;
    font-weight: bold;
    border-bottom: 2px solid #444;
}

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

/* ==========================================================================
   3. ZONE DÉFILANTE (SCROLL)
   ========================================================================== */
.scrollable-inventory {
    max-height: 65vh; /* Ajustable selon le confort de l'écran */
    overflow-y: auto;
    scrollbar-gutter: stable;
    border-bottom: 2px solid var(--couleur-bordure);
}

/* Custom Scrollbar */
.scrollable-inventory::-webkit-scrollbar { width: 10px; }
.scrollable-inventory::-webkit-scrollbar-track { background: #f1f1f1; }
.scrollable-inventory::-webkit-scrollbar-thumb { 
    background: #c19bc9; 
    border-radius: 10px; 
}
.scrollable-inventory::-webkit-scrollbar-thumb:hover { background: var(--couleur-primaire); }

/* ==========================================================================
   4. STYLE DES LIGNES (CORPS) ET MESSAGES
   ========================================================================== */
.grid-container-content > div {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 5px;
    font-size: 13px;
    min-height: 70px;
    background-color: white;
    border-bottom: 1px solid var(--couleur-bordure);
    border-right: 1px solid var(--couleur-bordure);
}

.grid-container-content > div:last-child { border-right: none; }

/* Effet Zébré */
.grid-container-content:nth-of-type(even) > div { background-color: #fcfaff; }

/* Survol (Hover) */
.grid-container-content:hover > div { background-color: #f4e8f9 !important; }

/* Alerte Stock (Rouge) */
.grid-container-content.stock-alerte > div {
    background-color: #ffecec !important;
    color: #b30000;
    font-weight: bold;
}

/* ==========================================================================
   5. BOUTONS ET ÉLÉMENTS INTERACTIFS
   ========================================================================== */
.action-btns {
    flex-direction: column;
    gap: 5px;
}

.btn-modifier, .btn-retirer {
    width: 90px;
    padding: 6px 0;
    font-size: 11px;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-modifier { background-color: #3498db; }
.btn-retirer { background-color: #e74c3c; }
.btn-modifier:hover, .btn-retirer:hover { opacity: 0.8; }

.img-cell img {
    max-width: 60px;
    max-height: 60px;
    object-fit: contain;
    border-radius: 4px;
}

/* --- BOITE DE RECHERCHE ET BOUTON X --- */
.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-box input {
    width: 250px;
    padding: 10px;
    border: 2px solid var(--couleur-primaire);
    border-radius: 20px;
    text-align: center;
}

.btn-cancel-search {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: opacity 0.2s ease;
}

.btn-cancel-search:hover { opacity: 0.7; }

.btn-cancel-search img {
    width: 25px;
    margin-right: 5px;
}

.btn-cancel-search .texte-effacer {
    color: #d32f2f;
    font-weight: bold;
    font-size: 0.9em;
}

/* ==========================================================================
   6. STYLE DES FILTRES SUPÉRIEURS
   ========================================================================== */
.filtre-form {
    display: flex;
    gap: 15px; 
    align-items: center;
    margin: unset;
}

.groupe-filtre {
    display: flex;
    align-items: center;
    gap: 8px; 
}

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

.groupe-filtre select {
    padding: 6px 10px;
    border: 1px solid var(--couleur-bordure);
    border-radius: var(--radius);
    background-color: white;
    font-size: 13px;
    cursor: pointer;
}


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

/* --- BADGES DE STATUT POUR LES ITEMS --- */
.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

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

/* Badge : Sur demande (SYDA) - Reprend le mauve de la bannière */
.badge-syda {
    color: var(--couleur-primaire, #7b1c8d);
    background-color: #fdf7ff;
    border: 1px solid var(--couleur-primaire, #7b1c8d);
}

/* Badge : À commander - Orange alerte */
.badge-a-commander {
    color: #d35400;
    background-color: #fdf2e9;
    border: 1px solid #e67e22;
}

/* Badge : En commande (Transit/Attente) - Vert succès (car en route) */
.badge-en-commande {
    color: var(--couleur-succes, #27ae60);
    background-color: #eafaf1;
    border: 1px solid var(--couleur-succes, #27ae60);
}

/* Badge : En réservation - Bleu informatif avec bordure noire pour distinction */
.badge-reservation {
    color: black; 
    background-color: #ebf5fb; 
    border: 1px solid black; 
}