:root {
    --bleu: #1a56b0;
    --bleu-fonce: #123d80;
    --vert: #1c8a4b;
    --rouge: #c0392b;
    --orange: #d68910;
    --gris-fond: #f4f6f9;
    --gris-bordure: #dfe3e8;
    --texte: #1f2933;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--gris-fond);
    color: var(--texte);
}

header.entete {
    background: var(--bleu-fonce);
    color: #fff;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

header.entete a { color: #fff; text-decoration: none; }
header.entete .titre { font-weight: 600; font-size: 1.1rem; }
header.entete nav a {
    margin-left: 16px;
    opacity: 0.9;
    font-size: 0.95rem;
}
header.entete nav a:hover { opacity: 1; text-decoration: underline; }

main {
    max-width: 1000px;
    margin: 24px auto;
    padding: 0 16px 40px;
}

.carte {
    background: #fff;
    border: 1px solid var(--gris-bordure);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

h1 { font-size: 1.4rem; margin-top: 0; }
h2 { font-size: 1.15rem; margin-top: 0; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--gris-bordure); font-size: 0.92rem; }
th { color: #555; font-weight: 600; }

.etiquette {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}
.etiquette.ok       { background: #e3f6e9; color: var(--vert); }
.etiquette.retard    { background: #fdecea; color: var(--rouge); }
.etiquette.attente   { background: #fdf3e3; color: var(--orange); }
.etiquette.neutre    { background: #eceff3; color: #555; }

form.formulaire { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
form.formulaire.large { max-width: 640px; }
label { font-weight: 600; font-size: 0.9rem; }
input[type=text], input[type=tel], input[type=password], input[type=date],
input[type=file], select, textarea {
    padding: 9px 10px;
    border: 1px solid var(--gris-bordure);
    border-radius: 6px;
    font-size: 1rem;
    width: 100%;
}
textarea { min-height: 80px; font-family: inherit; }

button, .bouton {
    background: var(--bleu);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}
button:hover, .bouton:hover { background: var(--bleu-fonce); }
.bouton.secondaire { background: #fff; color: var(--bleu); border: 1px solid var(--bleu); }
.bouton.danger { background: var(--rouge); }
.bouton.reussite { background: var(--vert); }

.message-erreur {
    background: #fdecea;
    color: var(--rouge);
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
}
.message-succes {
    background: #e3f6e9;
    color: var(--vert);
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.grille-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.stat {
    background: #fff;
    border: 1px solid var(--gris-bordure);
    border-radius: 8px;
    padding: 14px;
    text-align: center;
}
.stat .valeur { font-size: 1.6rem; font-weight: 700; color: var(--bleu-fonce); }
.stat .libelle { font-size: 0.82rem; color: #666; }

.connexion-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90vh;
}
.connexion-carte { width: 100%; max-width: 360px; }

.pied { text-align: center; color: #888; font-size: 0.82rem; padding: 20px; }

@media (max-width: 600px) {
    header.entete { flex-direction: column; align-items: flex-start; }
}
