/* css/style.css */

:root { 
    --primary-yellow: #ffd600; /* Le jaune de l'en-tête */
    --header-dark: #2c2c2c; /* Le gris foncé pour l'onglet actif */
    --bg-main: #f4f5f7; /* Le gris très clair du fond de page */
    --bg-sidebar: #ffffff; /* Le blanc de la barre latérale */
    --text-main: #333333;
    --text-muted: #888888;
    --accent-blue: #007bff; /* Pour le bouton "+" */
}

body { 
    margin: 0; 
    font-family: 'Segoe UI', Roboto, sans-serif; 
    background-color: var(--bg-main); 
    color: var(--text-main); 
}

/* =========================================
   HEADER (BARRE SUPÉRIEURE)
========================================= */
.top-header {
    display: flex;
    align-items: center;
    background-color: var(--primary-yellow);
    height: 60px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}

.logo-area {
    width: 250px;
    padding: 0 20px;
    font-weight: bold;
    font-size: 1.1rem;
    line-height: 1.2;
    text-transform: uppercase;
}

.top-nav {
    display: flex;
    height: 100%;
}

.top-nav a {
    display: flex;
    align-items: center;
    padding: 0 20px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.85rem;
    text-transform: uppercase;
    transition: background 0.2s;
}

.top-nav a.active {
    background-color: var(--header-dark);
    color: var(--primary-yellow);
}

.user-actions {
    margin-left: auto;
    padding-right: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.85rem;
    font-weight: bold;
}

.user-actions a {
    color: var(--text-main);
    text-decoration: none;
}

/* =========================================
   LAYOUT PRINCIPAL
========================================= */
.main-layout { 
    display: flex; 
    padding-top: 60px; /* Compense la hauteur du header fixe */
    min-height: 100vh; 
    box-sizing: border-box;
}

/* =========================================
   SIDEBAR & TREE (ARBRE DES CATÉGORIES CORRIGÉ)
========================================= */
.sidebar { 
    width: 280px; 
    background: var(--bg-sidebar); 
    padding: 20px 0; 
    box-sizing: border-box; 
    height: calc(100vh - 60px);
    position: fixed;
    overflow-y: auto;
}

.tree-root { list-style: none; padding: 0; margin: 0; }
.tree-child { list-style: none; padding-left: 25px; margin: 0; display: none; /* Cache les sous-catégories par défaut */ }

.tree-item { 
    display: flex; 
    align-items: center; 
    padding: 10px 20px; 
    cursor: pointer; 
    font-size: 0.85rem; 
    color: var(--text-main);
    text-transform: uppercase;
    transition: background 0.2s;
}

.tree-item:hover { background-color: #f4f5f7; }

/* Le chevron d'ouverture/fermeture */
.tree-chevron {
    width: 20px;
    font-weight: bold;
    font-size: 1.1rem;
    display: inline-block;
}

/* La classe pour mettre en gras l'élément actif */
.active-node {
    font-weight: bold;
    color: #000;
}
/* =========================================
   ZONE DE CONTENU & GRILLE
========================================= */
.content-area { 
    margin-left: 280px; /* Laisse la place à la sidebar fixe */
    padding: 30px 40px; 
    flex-grow: 1;
}

.filter-bar { 
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px; 
    display: flex; 
    gap: 15px; 
    align-items: center; 
}

.filter-bar select { 
    padding: 8px 15px; 
    border: 1px solid #ddd; 
    border-radius: 4px;
    background: #fafafa; 
}

.products-grid { 
    display: grid; 
    grid-template-columns: repeat(5, 1fr); /* 5 colonnes pour correspondre à l'image */
    gap: 20px; 
}

/* Style des vignettes type "Asset" */
.product-card { 
    position: relative;
    background: #fff; 
    border-radius: 8px; 
    overflow: hidden; 
    aspect-ratio: 1 / 1; /* Force les cartes à être carrées */
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
}

.product-card img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

/* Superposition du texte en bas de l'image */
.product-info { 
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 10px 10px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    box-sizing: border-box;
}

.product-info h3 { 
    margin: 0; 
    font-size: 0.8rem; 
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Coupe le texte trop long avec "..." */
}

/* =========================================
   BOUTON D'ACTION FLOTTANT (FAB)
========================================= */
.floating-actions {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

.btn-yellow {
    background-color: var(--primary-yellow);
    color: var(--text-main);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-blue {
    background-color: var(--accent-blue);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    font-size: 1.5rem;
    line-height: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   POPUP / MODAL (Inchangé structurellement, adapté couleurs)
========================================= */
.modal { display: none; position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.85); justify-content: center; align-items: center; z-index: 1000; }
.modal-content { background: #fff; padding: 30px; width: 800px; max-width: 90%; display: flex; gap: 20px; position: relative; border-radius: 8px; }
.modal-content img { width: 50%; max-height: 500px; object-fit: contain; background: #f4f5f7; border-radius: 4px; }
.modal-details { width: 50%; display: flex; flex-direction: column; }
.close-modal { position: absolute; top: 10px; right: 15px; font-size: 1.5rem; cursor: pointer; color: #333; }
.order-form input, .order-form textarea { width: 100%; padding: 10px; margin-bottom: 10px; box-sizing: border-box; border: 1px solid #ddd; border-radius: 4px; }
.btn-order { background: var(--header-dark); color: var(--primary-yellow); padding: 10px; border: none; font-weight: bold; cursor: pointer; border-radius: 4px; text-transform: uppercase;}

/* =========================================
   FORMULAIRES ET LOGIN (Thème Vente Flash)
========================================= */
.login-body {
    background-color: var(--bg-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.login-container {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 400px;
    border-top: 4px solid var(--primary-yellow);
}

.login-container h2 {
    text-align: center;
    color: var(--header-dark);
    margin-top: 0;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    background: #fafafa;
    font-family: inherit;
    color: var(--text-main);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-yellow);
    background: #fff;
}

.btn-submit {
    background: var(--header-dark);
    color: var(--primary-yellow);
    padding: 15px;
    border: none;
    width: 100%;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    transition: background 0.3s;
}

.btn-submit:hover {
    background: #000;
}

.msg.error {
    background: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9rem;
    border: 1px solid #ef9a9a;
}

/* =========================================
   TABLEAUX D'ADMINISTRATION
========================================= */
.admin-content {
    padding: 100px 40px 40px 40px; /* Espace en haut pour le header fixe */
    max-width: 1200px;
    margin: 0 auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.admin-table th, .admin-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background-color: var(--header-dark);
    color: var(--primary-yellow);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.admin-table tr:hover {
    background-color: #f9f9f9;
}

/* Badges de statut */
.status-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}
.status-en_attente { background: #fff3cd; color: #856404; }
.status-traitee { background: #d4edda; color: #155724; }
.status-annulee { background: #f8d7da; color: #721c24; }

.form-inline {
    display: flex;
    gap: 10px;
}
.form-inline select {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}