/* Variables de base */
:root {
    --primary-color: #1BC45D;
    --secondary-color: #eaf3fb;
    --background-color: #F0F5F4;
    --text-color: #1a2a3a;
    --light-border: #e5e5e5;
    --highlight-bg: #f0f6fb;
}

/* Styles généraux */
body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--background-color);
    margin: 0;
    color: var(--text-color);
    /* Correction majeure pour la mise en page complète */
    display: flex;
    flex-direction: column;
    min-height: 100vh; 
}

header {
    background: var(--primary-color);
    color: #fff;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

header h1 {
    margin: 0;
    font-size: 20px;
}

header small {
    font-size: 12px;
}

header input[type="text"] {
    padding: 6px 8px;
    border-radius: 5px;
    border: none;
}

nav {
    background: var(--secondary-color);
    padding: 10px 20px;
    flex-shrink: 0; /* Assure que la nav ne prend pas d'espace vertical inutile */
}

nav a {
    color: var(--primary-color);
    text-decoration: none;
    margin-right: 15px;
    font-weight: bold;
}

/* Conteneur principal (3 colonnes) */
.container {
    flex-grow: 1; /* Permet au conteneur de remplir l'espace restant */
    display: grid;
    grid-template-columns: 250px 1fr 280px; /* Sidebar | Main Content | Right Panel */
    gap: 15px;
    padding: 20px;
}

.full-container { /* Pour les pages sans la sidebar droite */
    flex-grow: 1; 
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 15px;
    padding: 20px;
}

.sidebar, .main, .right, .form-card {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Sidebar (Menu de navigation gauche) */
.sidebar h3 {
    font-size: 15px;
    margin-top: 0;
}

.sidebar a {
    display: block;
    color: var(--primary-color);
    text-decoration: none;
    padding: 5px 0;
}

.sidebar a:hover {
    text-decoration: underline;
}

.sidebar button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

.sidebar button:hover {
    opacity: 0.9;
}

.main h2 {
    margin-top: 0;
    color: var(--primary-color);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--light-border);
}

th {
    background: var(--highlight-bg);
    color: var(--primary-color);
}

/* Colonne droite */
.right h4 {
    margin-top: 0;
    color: var(--primary-color);
}

.ad {
    background: #f4f9ff;
    border: 1px solid #d3e5f7;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
    text-align: center;
}

/* Formulaires et Boutons */
label {
    display: block;
    margin-top: 10px;
    font-weight: bold;
}

input[type="text"], input[type="number"], input[type="password"], input[type="email"], select {
    width: calc(100% - 22px);
    padding: 10px;
    margin-top: 5px;
    border: 1px solid var(--light-border);
    border-radius: 5px;
    box-sizing: border-box;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px;
    display: inline-block;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: #ccc;
    color: var(--text-color);
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px;
    margin-left: 10px;
}

/* Utilitaires */
.error {
    color: red;
    font-weight: bold;
    margin-top: 10px;
}

.success {
    color: green;
    font-weight: bold;
    margin-top: 10px;
}

hr {
    border: 0;
    height: 1px;
    background: var(--light-border);
    margin: 15px 0;
}

/* Pied de page */
footer {
    background: var(--secondary-color);
    text-align: center;
    padding: 10px;
    font-size: 13px;
    color: #4a5b6c;
    margin-top: auto; /* Pousse le footer tout en bas */
    flex-shrink: 0;
}