/* Fichier: assets/css/style.css */

/* --- RESET & TYPOGRAPHIE DE BASE --- */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8; /* Ajout d'une couleur d'information */
    --bg-light: #f8f9fa;
    --text-dark: #343a40;
    --border-color: #e9ecef; /* Bordures plus claires */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Police plus moderne */
    --padding-base: 15px;
    --header-height: 60px;
}
h1{
	font-size:1.5em;
}
h2{
	font-size:1.3em;
}
h3{
	font-size:1.1em;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #ffffff;
}

h1, h2, h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

/* --- STRUCTURE GÉNÉRALE --- */
.container {
    width: 90%;
    margin: 0 auto;
    padding: var(--padding-base);
}

/* Contenu principal après le header */
.main-content {
    padding-top: 20px;
}

/* --- CONNEXION (login.php) --- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--bg-light);
}

.login-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-form h1 {
    text-align: center;
    margin-bottom: 20px;
}

/* --- FORMULAIRES (Connexion & Admin/CRUD) --- */
form div {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* --- BOUTONS --- */
button, .btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #bd2130;
}


/* --- NAVIGATION (HEADER) --- */
header {
    background-color: var(--text-dark);
    color: white;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: space-between;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 10px;
    display: block;
}

nav ul li a:hover {
    background-color: #495057;
}

/* --- LISTES ET TABLES (Pour les pages Admin CRUD) --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th, table td {
    padding: 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

table th {
    background-color: var(--bg-light);
    font-weight: bold;
}

/* --- MISE EN PAGE SPÉCIFIQUE ADMIN/STORES --- */
/* --- MISE EN PAGE SPÉCIFIQUE ADMIN/STORES --- */
/* --- MISE EN PAGE SPÉCIFIQUE ADMIN/STORES --- */
/* --- MISE EN PAGE SPÉCIFIQUE ADMIN/STORES --- */
/* --- MISE EN PAGE SPÉCIFIQUE ADMIN/STORES --- */
.stores-layout {
    display: flex;
    gap: 30px; /* Espace entre les deux colonnes */
    align-items: flex-start; /* Aligne le contenu en haut */
}

/* Le conteneur du formulaire (Ajouter/Modifier) */
.stores-form-container {
    flex: 1; /* Prend 1/5 de l'espace total */
    min-width: 300px; /* Assure que le formulaire reste utilisable sur les petits écrans */
    padding: 20px;
    background-color: var(--bg-light);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky; /* Reste visible lors du défilement de la liste */
    top: 20px; /* Distance du haut */
}

/* Le conteneur du tableau (Liste des magasins) */
.stores-list-container {
    flex: 4; /* Prend 4/5 de l'espace total */
}

/* Optionnel: Rendre la disposition verticale sur les petits écrans */
@media (max-width: 992px) {
    .stores-layout {
        flex-direction: column; /* Empile les éléments */
        gap: 20px;
    }
    .stores-form-container {
        width: 100%; /* Reprend toute la largeur */
        position: static; /* Supprime l'effet sticky */
    }
}


/* --- MISE EN PAGE GÉNÉRIQUE POUR LES PAGES D'ADMINISTRATION (Ex: users.php, stores.php) --- */
/* --- MISE EN PAGE GÉNÉRIQUE POUR LES PAGES D'ADMINISTRATION (Ex: users.php, stores.php) --- */
/* --- MISE EN PAGE GÉNÉRIQUE POUR LES PAGES D'ADMINISTRATION (Ex: users.php, stores.php) --- */

.admin-layout {
    display: flex;
    gap: 30px; /* Espace entre les deux colonnes */
    align-items: flex-start; /* Aligne le contenu en haut */
}

/* Le conteneur du formulaire (Flex 1) */
.form-container {
    flex: 1; /* Prend 1/5 de l'espace total */
    min-width: 300px;
    padding: 20px;
    background-color: var(--bg-light, #f4f4f4); /* Couleur de fond pour le formulaire */
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky; /* Reste visible lors du défilement de la liste */
    top: 20px; 
}

/* Le conteneur du tableau (Flex 4) */
.list-container {
    flex: 4; /* Prend 4/5 de l'espace total */
}

/* Media Query pour les petits écrans */
@media (max-width: 992px) {
    .admin-layout {
        flex-direction: column; /* Empile les éléments */
        gap: 20px;
    }
    .form-container {
        width: 100%;
        position: static;
    }
}

/* IMPORTANT : Vous pouvez maintenant remplacer les classes .stores-layout, .stores-form-container et .stores-list-container 
   de votre fichier stores.php par .admin-layout, .form-container et .list-container pour réutiliser ce CSS. */
   
   /* Fichier: assets/css/style.css (Correction du Modal) */
   /* Fichier: assets/css/style.css (Correction du Modal) */
   /* Fichier: assets/css/style.css (Correction du Modal) */
   /* Fichier: assets/css/style.css (Correction du Modal) */

.modal {
    display: none; /* Masqué par défaut (comme déjà défini) */
    
    /* ATTENTION : C'est la partie cruciale pour le positionnement */
    position: fixed; /* Maintient le modal visible même en défilant */
    z-index: 1000; /* Assure qu'il est AU-DESSUS de tout le reste */
    
    left: 0;
    top: 0;
    width: 100%; /* Prend toute la largeur de l'écran */
    height: 100%; /* Prend toute la hauteur de l'écran */
    overflow: auto;
    
    /* Arrière-plan semi-transparent pour assombrir le contenu derrière */
    background-color: rgba(0, 0, 0, 0.4); 
}

.modal-content {
    background-color: #fff;
    /* Ajustement du centrage et de la taille du contenu */
    margin: 10% auto; /* 10% du haut, centré horizontalement */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 80%;
    max-width: 600px;
    position: relative; /* Nécessaire pour positionner le bouton de fermeture */
}

/* Fichier: assets/css/style.css (Ajouts optionnels) */

/* Couleurs de fond pour les mouvements dans l'historique */
/* Couleurs de fond pour les mouvements dans l'historique */
.movement-entree {
    background-color: #d4edda; /* Vert clair */
}
.movement-sortie {
    background-color: #f8d7da; /* Rouge clair */
}
.movement-transfert {
    background-color: #fff3cd; /* Jaune clair */
}