/* Palette bleue cohérente, design simple et lisible */
:root {
    --blue-navy: #002b4f;
    --blue-dark: #004e7a;
    --blue-main: #007bff;
    --blue-light: #e6f2ff;
    --grey-light: #f5f5f5;
    --text-main: #222222;
    --danger: #c82333;
    --success: #218838;
}

/* Reset / base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Fond plein écran bleu marine */
body {
    background: radial-gradient(circle at top, #004b8a 0%, var(--blue-navy) 55%, #00152b 100%);
    color: var(--text-main);
    padding: 20px;
    min-height: 100vh;
}

/* Carte blanche centrale */
.container {
    max-width: 1100px;
    margin: 0 auto;
    background: #ffffff;
    padding: 24px 22px 30px 22px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
}

/* Header avec logo centré */
header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--blue-main);
    text-align: center;
}

/* Logo centré */
.logo-ecole {
    max-width: 90px;
    height: auto;
    display: block;
    margin: 0 auto 8px auto;
}

/* Titres */
h1 {
    font-size: 1.7rem;
    color: var(--blue-dark);
    margin-bottom: 8px;
    letter-spacing: 0.03em;
}

h2 {
    font-size: 1.3rem;
    color: var(--blue-main);
    margin-top: 20px;
    margin-bottom: 10px;
}

.sub-header {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 4px;
}

/* Cartouche établissement */
.school-info {
    background: linear-gradient(to right, var(--blue-light), #ffffff);
    border-left: 4px solid var(--blue-main);
    padding: 8px 10px;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

/* Formulaires */
label {
    display: block;
    margin: 10px 0 4px;
    font-weight: 600;
}

input[type="text"],
input[type="date"],
input[type="number"],
select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #999;
    font-size: 0.95rem;
    background-color: #ffffff;
    color: #000000;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--blue-main);
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* Messages d’info */
.info {
    font-size: 0.9rem;
    color: #FF0000;
    margin-top: 10px;
}

/* Boutons */
button,
.btn {
    display: inline-block;
    margin-top: 12px;
    padding: 9px 18px;
    border-radius: 999px;
    border: none;
    background: var(--blue-main);
    color: white;
    cursor: pointer;
    font-size: 0.95rem;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,123,255,0.35);
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

button:hover,
.btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0,86,179,0.4);
}

button:active,
.btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(0,86,179,0.3);
}

.btn-secondary {
    background: #6c757d;
    box-shadow: 0 4px 10px rgba(108,117,125,0.35);
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-danger {
    background: var(--danger);
    box-shadow: 0 4px 10px rgba(200,35,51,0.35);
}

.btn-danger:hover {
    background: #a71d2a;
}

.btn-success {
    background: var(--success);
    box-shadow: 0 4px 10px rgba(33,136,56,0.35);
}

.btn-success:hover {
    background: #1e7e34;
}

/* Tableaux */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.8rem;          /* plus petit dans tout le tableau */
}

th, td {
    border: 1px solid #dde2ea;
    padding: 4px 6px;
    text-align: center;
}

th {
    background: var(--blue-light);
    font-weight: 600;
}

/* Colonne des critères : pas de coupure de mots */
td.critere {
    text-align: left;
    white-space: nowrap;     /* pas de coupure de mots */
}

/* Table d'évaluation : éviter le scroll horizontal sur mobile */
#table-grille {
    table-layout: fixed;
    width: 100%;
}

#table-grille th,
#table-grille td {
    word-wrap: break-word;
    white-space: normal;
}

/* On réapplique le nowrap uniquement sur la colonne critère */
#table-grille td.critere {
    white-space: nowrap;
}

/* Entêtes d'élèves étroites pour tenir sur la largeur */
#table-grille th[data-eleve-index] {
    max-width: 70px;
}

/* Champs de notes dans le tableau (petits et lisibles) */
#table-grille input[type="number"] {
    width: 60px;
    padding: 3px 2px;
    font-size: 0.75rem;
    text-align: center;
    font-weight: 500;
}

tfoot td {
    font-weight: 700;
    background: #f0f8ff;
}

/* Messages (alertes) */
.alert {
    padding: 8px 10px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 0.9rem;
}

.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Grille prénoms */
.prenom-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.prenom-inputs input[type="text"] {
    text-transform: uppercase;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .container {
        padding: 16px 14px 22px 14px;
        border-radius: 0;
        max-width: 100%;
        min-height: 100vh;
    }
}
