* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: sans-serif;
    background: #f5f6f8;
    color: #222;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 2rem;
}

h1 {
    font-size: 1.8rem;
}

.logo-accueil {
    max-height: 18rem;
    max-width: min(70vw, 22rem);
    width: auto;
    height: auto;
}

.titre-avec-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.logo-petit {
    height: 2.4rem;
    width: auto;
}

.bouton {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    border: 1px solid #345;
    border-radius: 6px;
    background: #345;
    color: #fff;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    text-align: center;
}

.bouton:hover {
    background: #234;
}

.bouton.gros {
    font-size: 1.3rem;
    padding: 1rem 2.5rem;
}

.bouton.secondaire {
    background: #8b0000;
    border-color: #8b0000;
}

.bouton.secondaire:hover {
    background: #6d0000;
}

/* --- Journal des Pichets --- */

.jdp {
    justify-content: flex-start;
}

.saisie {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    padding: 1rem 1.25rem;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.saisie label {
    font-weight: bold;
}

.saisie input {
    padding: 0.5rem;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-size: 1rem;
}

.saisie input#prenom {
    width: 16rem;
}

.saisie input#nombre {
    width: 6rem;
}

.saisie .bouton {
    font-weight: bold;
}

.erreur {
    color: #b00020;
    font-weight: bold;
    background: #ffe8ea;
    border: 1px solid #b00020;
    border-radius: 6px;
    padding: 0.6rem 1rem;
}

.alerte-fut {
    color: #8a5300;
    font-weight: bold;
    background: #fff3d6;
    border: 1px solid #d18800;
    border-radius: 6px;
    padding: 0.6rem 1rem;
}

.tableau-zone {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    width: 100%;
    max-width: 60rem;
}

.defilement {
    flex: 1;
    overflow-x: auto; /* le tableau défile horizontalement sur petit écran */
}

table {
    border-collapse: collapse;
    background: #fff;
}

th, td {
    border: 1px solid #bbb;
    padding: 0.5rem 0.9rem;
    text-align: left;
}

th {
    background: #345;
    color: #fff;
}

tr:nth-child(even) td {
    background: #eef0f4;
}

tr.cachee {
    display: none;
}

.actions-tableau {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-shrink: 0;
}

@media (max-width: 45rem) {
    .tableau-zone {
        flex-direction: column;
        align-items: stretch;
    }

    .actions-tableau {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* --- Petit écran (téléphone) --- */

@media (max-width: 32rem) {
    .page {
        padding: 1rem;
        gap: 1.25rem;
    }

    h1 {
        font-size: 1.4rem;
    }

    th, td {
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
    }

    .saisie input#prenom {
        width: 100%;
    }

    .bouton {
        padding: 0.7rem 1.2rem; /* zone de tap confortable */
    }

    .graphe-conteneur {
        height: 14rem;
    }
}

/* --- Statistiques --- */

.page.stats {
    justify-content: flex-start;
    gap: 1.5rem;
}

.retour {
    align-self: flex-start;
    color: #345;
}

.cartes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 1rem;
    width: 100%;
    max-width: 60rem;
}

.carte {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.carte .valeur {
    font-size: 1.5rem;
    font-weight: bold;
}

.carte .libelle {
    font-size: 0.85rem;
    color: #667;
    margin-top: 0.3rem;
}

.graphe {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    width: 100%;
    max-width: 60rem;
}

.graphe h2 {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
}

.graphe-conteneur {
    position: relative;
    height: 18rem;
}
