/* Fichier : app/static/css/style.css
   Toute l'apparence du site. Les couleurs se changent ici, tout en haut. */

:root {
    --principale: #2563eb;      /* bleu : boutons, liens */
    --principale-fonce: #1d4ed8;
    --fond: #f3f4f6;            /* gris très clair : fond de page */
    --texte: #1f2937;           /* gris foncé */
    --texte-leger: #6b7280;
    --carte: #ffffff;
    --bordure: #e5e7eb;
    --vert: #15803d;
    --vert-fond: #dcfce7;
    --rouge: #b91c1c;
    --rouge-fond: #fee2e2;
    --orange: #b45309;
    --orange-fond: #fef3c7;
    --bleu-fond: #dbeafe;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, "Segoe UI", Arial, sans-serif;
    background: var(--fond);
    color: var(--texte);
    line-height: 1.5;
}

a { color: var(--principale); }
h1 { margin-top: 0; }
h2 { margin-top: 0; font-size: 1.15rem; }
small { color: var(--texte-leger); }
code { background: var(--fond); padding: 1px 5px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ---------- Menu de gauche ---------- */
.menu {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: 210px;
    background: #111827;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.menu .logo { color: white; font-weight: bold; font-size: 1.1rem; margin: 0 8px 20px; }
.menu .logo small { color: #9ca3af; font-weight: normal; }
.menu a { color: #d1d5db; text-decoration: none; padding: 8px 10px; border-radius: 6px; }
.menu a:hover { background: #1f2937; color: white; }
.menu-bas { margin-top: auto; color: #9ca3af; display: flex; flex-direction: column; gap: 6px; padding: 0 8px; }

/* ---------- Zone de contenu ---------- */
.contenu { margin-left: 210px; padding: 28px 32px; max-width: 1400px; }
.contenu-seul { margin: 0 auto; }
.titre-page { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.titre-page h1 { margin: 0; }

.carte {
    background: var(--carte);
    border-radius: 8px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.carte-etroite { max-width: 400px; margin: 60px auto; }

/* ---------- Formulaires ---------- */
label { display: block; margin-bottom: 14px; font-weight: 600; }
label small { font-weight: normal; }
input[type="text"], input[type="password"], input[type="number"], input[type="file"], select, textarea {
    display: block;
    width: 100%;
    max-width: 480px;
    margin-top: 4px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font: inherit;
    background: white;
}
textarea { max-width: 100%; }
label.case { font-weight: normal; display: flex; gap: 8px; align-items: center; }
.en-ligne { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 12px; }
.en-ligne label { margin-bottom: 0; }

/* ---------- Boutons ---------- */
.bouton {
    display: inline-block;
    background: var(--principale);
    color: white;
    border: 1px solid var(--principale);
    border-radius: 6px;
    padding: 7px 14px;
    font: inherit;
    font-size: 0.92rem;
    cursor: pointer;
    text-decoration: none;
}
.bouton:hover { background: var(--principale-fonce); }
.bouton.discret { background: white; color: var(--texte); border-color: #d1d5db; }
.bouton.discret:hover { background: var(--fond); }
.bouton.danger { color: var(--rouge); }
.bouton-valider { background: var(--vert); border-color: var(--vert); }
.bouton-valider:hover { background: #166534; }
.menu .bouton.discret { background: transparent; color: #d1d5db; border-color: #4b5563; }

/* ---------- Messages ---------- */
.message { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; border: 1px solid transparent; }
.message ul { margin: 6px 0 0; padding-left: 20px; }
.message-succes { background: var(--vert-fond); color: #14532d; border-color: #86efac; }
.message-erreur { background: var(--rouge-fond); color: #7f1d1d; border-color: #fca5a5; }
.message-info { background: var(--bleu-fond); color: #1e3a8a; border-color: #93c5fd; }
.texte-erreur { color: var(--rouge); }

/* ---------- Tableaux ---------- */
.tableau { width: 100%; border-collapse: collapse; background: var(--carte); border-radius: 8px; overflow: hidden; }
.tableau th, .tableau td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--bordure); vertical-align: top; }
.tableau th { background: #f9fafb; font-size: 0.85rem; color: var(--texte-leger); }
.tableau .actions { white-space: nowrap; }
.tableau .actions form { display: inline; }
.tableau audio { height: 34px; width: 240px; }
.tableau-verification tr:target { background: #eff6ff; }   /* ligne sur laquelle on vient d'agir */
.defilement { overflow-x: auto; margin-bottom: 16px; }
progress { width: 100%; height: 12px; }

/* ---------- Statuts (badges) ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; white-space: nowrap; background: var(--fond); }
.badge-genere { background: var(--bleu-fond); color: #1e40af; }
.badge-valide { background: var(--vert-fond); color: var(--vert); }
.badge-a_verifier, .badge-a_regenerer { background: var(--orange-fond); color: var(--orange); }
.badge-erreur { background: var(--rouge-fond); color: var(--rouge); }
.controle { font-size: 0.82rem; white-space: nowrap; margin-right: 6px; }
.controle-ok { color: var(--vert); }
.controle-ko { color: var(--rouge); font-weight: bold; }

/* ---------- Pages d'un projet ---------- */
.onglets { display: flex; gap: 4px; border-bottom: 2px solid var(--bordure); margin-bottom: 20px; }
.onglets a { padding: 8px 16px; text-decoration: none; color: var(--texte-leger); border-radius: 6px 6px 0 0; }
.onglets a.actif { background: var(--carte); color: var(--principale); font-weight: bold; border: 2px solid var(--bordure); border-bottom-color: var(--carte); margin-bottom: -2px; }

.gros-chiffre { font-size: 2rem; font-weight: bold; margin: 8px 0; }
.compteurs { display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 8px; }

.filtres { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.filtres a { padding: 4px 12px; border-radius: 999px; background: var(--carte); border: 1px solid var(--bordure); text-decoration: none; color: var(--texte); font-size: 0.9rem; }
.filtres a.actif { background: var(--principale); color: white; border-color: var(--principale); }

.barre-lot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--carte); padding: 10px 12px; border-radius: 8px; margin-bottom: 10px; position: sticky; top: 0; z-index: 1; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.barre-lot label { margin: 0; }
details summary { cursor: pointer; color: var(--principale); font-size: 0.88rem; margin-top: 4px; }
details textarea { margin-bottom: 6px; }
.historique { font-size: 0.85rem; color: var(--texte-leger); padding-left: 18px; }
.liste-voix { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

/* ---------- Petits écrans ---------- */
@media (max-width: 800px) {
    .menu { position: static; width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .menu .logo { margin: 0 8px; }
    .menu-bas { margin: 0; flex-direction: row; align-items: center; }
    .contenu { margin-left: 0; padding: 16px; }
}
