/* Orchestre : jetons de design (voir le skill orchestre-ci4) */
:root {
    --fond: #EDF0F2;
    --fond-menu: #F8F9FA;
    --surface: #FFFFFF;
    --texte: #151B26;
    --texte-2: #566174;
    --bordure: #D8DEE4;
    --bordure-fine: #E4E8EC;
    --bordure-champ: #B9C2CE;
    --orchestre: #2B3A8C;
    --orchestre-doux: #E3E8F6;

    --ok-fond: #DDF1E7;      --ok-texte: #0B5A3A;
    --degrade-fond: #FBE9CF; --degrade-texte: #6B3F04;
    --erreur-fond: #F8DADA;  --erreur-texte: #7A1B1B;
    --neutre-fond: #E7EAF0;  --neutre-texte: #3A4559;

    --rayon-panneau: 12px;
    --rayon-champ: 8px;
    --police-titre: "Bricolage Grotesque", system-ui, sans-serif;
    --police: "Instrument Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--fond);
    color: var(--texte);
    font: 400 15px/1.5 var(--police);
}

a { color: var(--orchestre); }
h1, h2, h3 { font-family: var(--police-titre); font-weight: 600; margin: 0; line-height: 1.2; }
h1 { font-size: 34px; }
h2 { font-size: 20px; }

/* Structure : menu latéral de 240 px, contenu à droite */
.page { display: flex; min-height: 100%; }

.menu {
    flex: 0 0 240px;
    background: var(--fond-menu);
    border-right: 1px solid var(--bordure);
    padding: 24px 16px;
}
.menu-marque { display: flex; align-items: center; gap: 10px; margin: 0 8px 28px; font-family: var(--police-titre); font-size: 20px; font-weight: 600; }
.menu-groupe { margin-bottom: 22px; }
.menu-groupe-titre { margin: 0 8px 6px; font-size: 13px; font-weight: 600; color: var(--texte-2); }
.menu a {
    display: flex; align-items: center; gap: 10px;
    min-height: 40px; padding: 8px; border-radius: var(--rayon-champ);
    color: var(--texte); text-decoration: none;
}
.menu a:hover { background: var(--orchestre-doux); }
.menu a[aria-current="page"] { background: var(--orchestre-doux); color: var(--orchestre); font-weight: 600; }
.menu-utilisateur { border-top: 1px solid var(--bordure-fine); padding: 16px 8px 0; font-size: 14px; color: var(--texte-2); }
.menu-utilisateur strong { display: block; color: var(--texte); }

.contenu { flex: 1; min-width: 0; padding: 32px 40px 48px; }

.entete { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.entete p { margin: 8px 0 0; color: var(--texte-2); max-width: 680px; }

@media (max-width: 800px) {
    .page { flex-direction: column; }
    .menu { flex: none; border-right: 0; border-bottom: 1px solid var(--bordure); }
    .contenu { padding: 24px 16px 40px; }
    .entete { flex-direction: column; }
    h1 { font-size: 28px; }
}

/* Panneaux */
.panneau {
    background: var(--surface);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon-panneau);
    padding: 24px;
    margin-bottom: 24px;
}
.panneau > h2 { margin-bottom: 6px; }
.panneau > .note { margin: 0 0 18px; }
.note { color: var(--texte-2); font-size: 14px; }
.grille-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1100px) { .grille-2 { grid-template-columns: 1fr; } }

/* Point de couleur d'application */
.point { display: inline-block; width: 10px; height: 10px; border-radius: 999px; flex: none; }

/* Pastilles de statut : toujours un libellé */
.pastille { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.pastille-ok { background: var(--ok-fond); color: var(--ok-texte); }
.pastille-degrade { background: var(--degrade-fond); color: var(--degrade-texte); }
.pastille-erreur { background: var(--erreur-fond); color: var(--erreur-texte); }
.pastille-neutre { background: var(--neutre-fond); color: var(--neutre-texte); }
.pastille-orchestre { background: var(--orchestre-doux); color: var(--orchestre); }

/* Tableaux */
.defilement { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--bordure-fine); vertical-align: middle; }
th { font-size: 13px; font-weight: 600; color: var(--texte-2); }
tr:last-child td { border-bottom: 0; }
td.etroit, th.etroit { width: 1%; white-space: nowrap; }

/* Formulaires */
label { display: block; font-weight: 500; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
    width: 100%; min-height: 44px; padding: 8px 12px;
    border: 1px solid var(--bordure-champ); border-radius: var(--rayon-champ);
    background: var(--surface); color: var(--texte); font: inherit;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
    outline: 2px solid var(--orchestre); outline-offset: 2px;
}
.champ { margin-bottom: 16px; }
.champ-aide { font-size: 13px; color: var(--texte-2); margin-top: 4px; }
.case { display: flex; align-items: center; gap: 10px; min-height: 36px; font-weight: 400; }
.case input { width: 18px; height: 18px; }

.bouton {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 8px 18px;
    border: 1px solid var(--orchestre); border-radius: var(--rayon-champ);
    background: var(--orchestre); color: #fff; font: 600 15px var(--police);
    cursor: pointer; text-decoration: none;
}
.bouton-secondaire { background: var(--surface); color: var(--orchestre); }
.bouton-lien { border: 0; background: none; color: var(--orchestre); padding: 0; min-height: 0; font: inherit; text-decoration: underline; cursor: pointer; }

/* Messages */
.message { padding: 12px 16px; border-radius: var(--rayon-champ); margin-bottom: 20px; }
.message-ok { background: var(--ok-fond); color: var(--ok-texte); }
.message-erreur { background: var(--erreur-fond); color: var(--erreur-texte); }
.message ul { margin: 0; padding-left: 18px; }

.vide { padding: 24px; text-align: center; color: var(--texte-2); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.app-nom { display: inline-flex; align-items: center; gap: 8px; }
.pastilles { display: flex; flex-wrap: wrap; gap: 6px; }
.filtre { display: flex; gap: 12px; align-items: end; margin-bottom: 16px; flex-wrap: wrap; }
.filtre .champ { margin: 0; flex: 1; min-width: 220px; }
.filtre-utilisateurs .champ { flex: 1 1 160px; min-width: 150px; }
.filtre-utilisateurs .champ-large { flex: 2 1 240px; }

/* Chiffres clés */
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.chiffre { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon-panneau); padding: 18px 20px; }
.chiffre p { margin: 0; }
.chiffre-libelle { font-weight: 500; color: var(--texte-2); }
.chiffre-valeur { font-family: var(--police-titre); font-weight: 600; font-size: 40px; line-height: 1.15; margin: 4px 0 6px !important; font-variant-numeric: tabular-nums; }

/* Matrice : une seule teinte, du clair au foncé (5 paliers) */
:root {
    --seq-1: #E3E8F6; --seq-2: #C3CDEC; --seq-3: #93A3D8; --seq-4: #4A5BAA; --seq-5: #2B3A8C;
}
.matrice th, .matrice td { border-bottom: 2px solid var(--surface); }
.matrice td.nombre, .matrice th.nombre { text-align: center; min-width: 72px; }
.matrice td.case-1 { background: var(--seq-1); }
.matrice td.case-2 { background: var(--seq-2); }
.matrice td.case-3 { background: var(--seq-3); }
.matrice td.case-4 { background: var(--seq-4); }
.matrice td.case-5 { background: var(--seq-5); }
.matrice td.case-1, .matrice td.case-2, .matrice td.case-3 { border-left: 2px solid var(--surface); }
.matrice td.case-4, .matrice td.case-5 { border-left: 2px solid var(--surface); color: #fff; }
.matrice td.case-4 a, .matrice td.case-5 a { color: #fff; }
.matrice td a { color: inherit; font-weight: 600; }
.matrice .zero { color: var(--texte-2); }
.matrice .total { font-weight: 600; background: var(--fond-menu); }
.matrice tfoot th, .matrice tfoot td { border-top: 1px solid var(--bordure); }

/* Barres horizontales : marque fine, extrémité arrondie, valeur en texte */
.grille-egale { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.barre-ligne { display: grid; grid-template-columns: minmax(110px, 180px) 1fr 40px; align-items: center; gap: 12px; min-height: 32px; }
.barre-libelle { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barre-piste { height: 12px; }
.barre { display: block; height: 12px; min-width: 2px; background: var(--orchestre); border-radius: 0 4px 4px 0; }
.barre-valeur { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.barre-ligne:hover .barre-libelle { color: var(--orchestre); }

.a-traiter { list-style: none; margin: 0; padding: 0; }
.a-traiter li { padding: 10px 0; border-top: 1px solid var(--bordure-fine); }
.a-traiter li:first-child { border-top: 0; }

/* Page de connexion */
.connexion { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.connexion .panneau { width: 100%; max-width: 420px; margin: 0; }
.connexion h1 { font-size: 28px; margin-bottom: 6px; }
