:root {
    --fond: #f4f6f9;
    --carte: #ffffff;
    --bordure: #dde3ea;
    --texte: #24303d;
    --texte-doux: #62707e;
    --accent: #3a6ea5;
    --accent-doux: #eaf1f9;
    --succes: #2f8f5b;
    --danger: #c0392b;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Nunito', system-ui, sans-serif;
    background: var(--fond);
    color: var(--texte);
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: var(--carte);
    border-bottom: 1px solid var(--bordure);
}

.site-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    font-family: 'Fredoka', sans-serif;
    font-size: 2.3em;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    color: var(--texte);
    margin: 28px 0 6px;
}

.site-logo span { color: var(--accent); }

.site-logo-icone { font-size: 0.85em; line-height: 1; }

.site-sous-logo {
    text-align: center;
    color: var(--texte-doux);
    margin: -4px 0 20px;
}

.site-conteneur {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 16px 60px;
}

.site-conteneur-large {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 60px;
}

.site-carte {
    background: var(--carte);
    border: 1px solid var(--bordure);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
}

.site-sous-titre { color: var(--texte-doux); }

.site-btn {
    display: inline-block;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 1em;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.site-btn-primaire { background: var(--accent); color: #fff; }
.site-btn-primaire:hover { background: #2f5a86; }

.site-btn-secondaire { background: var(--accent-doux); color: var(--accent); }
.site-btn-secondaire:hover { background: #dbe8f5; }

.site-btn-texte { background: none; color: var(--texte-doux); padding: 6px 10px; }
.site-btn-texte:hover { color: var(--texte); }

.site-btn:disabled { opacity: 0.4; cursor: default; }
.site-btn:disabled:hover { color: var(--texte-doux); }

.site-champ {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--bordure);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1em;
    margin-bottom: 12px;
}

textarea.site-champ { resize: vertical; min-height: 90px; }

.messages-erreur {
    color: var(--danger);
    margin-bottom: 12px;
    min-height: 1.2em;
}

.lien-retour {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    margin-bottom: 16px;
}

.lien-retour:hover { text-decoration: underline; }

/* Sélecteur d'élève : filtre de bloc + recherche + liste cliquable */

.eleve-item {
    display: block;
    padding: 12px 16px;
    border: 1px solid var(--bordure);
    border-radius: 10px;
    margin-bottom: 8px;
    text-decoration: none;
    color: var(--texte);
    cursor: pointer;
    background: var(--carte);
}

.eleve-item:hover { border-color: var(--accent); }

.eleve-item-actif {
    border-color: var(--accent);
    background: var(--accent-doux);
}

.eleve-item-sous-titre {
    color: var(--texte-doux);
    font-size: 0.85em;
    margin-top: 2px;
}

/* Grille d'évaluation */

.grille-entete-eleve {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.grille-titre-sigle {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.3em;
    font-weight: 600;
    margin: 0;
}

.grille-competence {
    margin-top: 28px;
}

.grille-competence:first-child { margin-top: 0; }

.grille-competence-titre {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.05em;
    font-weight: 600;
    color: var(--accent);
    margin: 0 0 12px;
}

.grille-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    table-layout: fixed;
}

.grille-table th {
    background: var(--accent-doux);
    color: var(--accent);
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 8px 6px;
    text-align: center;
    border: 1px solid var(--bordure);
}

.grille-critere-titre {
    background: var(--fond);
    font-weight: 700;
    font-size: 0.85em;
    padding: 8px 10px;
    border: 1px solid var(--bordure);
    text-align: left;
}

.grille-critere-total {
    display: block;
    font-weight: 400;
    font-size: 0.95em;
    color: var(--texte-doux);
    margin-top: 2px;
}

.grille-habilete {
    padding: 8px 10px;
    border: 1px solid var(--bordure);
    font-weight: 700;
    font-size: 0.85em;
    vertical-align: top;
}

.grille-cellule {
    border: 1px solid var(--bordure);
    padding: 8px;
    font-size: 0.78em;
    line-height: 1.35;
    vertical-align: top;
    cursor: pointer;
    overflow-wrap: break-word;
}

.grille-cellule:hover { background: var(--accent-doux); }

.grille-cellule-note {
    display: block;
    font-weight: 700;
    font-size: 1.1em;
    color: var(--texte-doux);
    margin-bottom: 4px;
}

.grille-cellule-selectionnee {
    background: var(--accent-doux);
    border: 2px solid var(--accent);
}

.grille-cellule-selectionnee .grille-cellule-note { color: var(--accent); }

.grille-zero {
    border: 1px solid var(--bordure);
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    font-weight: 700;
    color: var(--texte-doux);
}

.grille-zero:hover { background: var(--accent-doux); }

.grille-zero-selectionnee {
    background: var(--danger);
    color: #fff;
}

.grille-total {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 8px;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.3em;
    font-weight: 600;
    margin: 20px 0;
}

.grille-total-max { color: var(--texte-doux); font-size: 0.75em; }

/* Mise en page mobile (cartes empilées verticalement) — construite en
   parallèle du tableau .grille-table-desktop (voir index.html) et cachée
   par défaut ; activée sous 700px, où le tableau à 8 colonnes forcerait un
   défilement horizontal peu pratique sur un téléphone. Un simple reflow
   CSS du tableau desktop ne suffit pas ici (cellule de critère fusionnée
   sur plusieurs lignes, 6 choix par ligne) — chaque option de notation
   devient plutôt un bouton pleine largeur, empilé verticalement, avec le
   libellé de l'échelle en clair (pas besoin de l'abréger, il y a la
   place). Copié/adapté de la même technique dans impax-ui/suivi,
   js/grille-rendu.js. */
.grille-cartes-mobile { display: none; }

.grille-carte-ligne {
    border: 1px solid var(--bordure);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    background: var(--carte);
}

.grille-carte-entete {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    font-weight: 700;
    font-size: 0.9em;
    margin-bottom: 4px;
}

.grille-carte-total { font-weight: 400; color: var(--texte-doux); white-space: nowrap; }

.grille-carte-habilete {
    color: var(--texte-doux);
    font-size: 0.85em;
    margin-bottom: 10px;
}

.grille-carte-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.grille-carte-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    background: var(--carte);
    border: 1px solid var(--bordure);
    border-radius: 8px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 0.85em;
    line-height: 1.3;
    cursor: pointer;
    color: var(--texte);
}

.grille-carte-option-note {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--fond);
    font-weight: 700;
    color: var(--texte-doux);
}

.grille-carte-option-texte-conteneur { display: block; }

.grille-carte-option-niveau { display: block; font-weight: 700; font-size: 0.9em; }

.grille-carte-option-texte { display: block; color: var(--texte-doux); }

.grille-carte-option-selectionnee {
    background: var(--accent-doux);
    border: 2px solid var(--accent);
}

.grille-carte-option-selectionnee .grille-carte-option-note { background: var(--accent); color: #fff; }

.grille-carte-option-zero {
    justify-content: center;
    font-weight: 700;
    color: var(--texte-doux);
}

.grille-carte-option-zero.grille-carte-option-selectionnee {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.grille-carte-option-zero.grille-carte-option-selectionnee .grille-carte-option-note {
    background: #fff;
    color: var(--danger);
}

@media (max-width: 700px) {
    .grille-table-desktop { display: none; }
    .grille-cartes-mobile { display: block; }
}
