/* ==========================================
   Base
   ========================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #ffffff;
    color: #222222;
}


/* ==========================================
   En-tête
   ========================================== */

.site-header {
    border-top: 28px solid #0875b9;
    border-bottom: 1px solid #dddddd;
    background: #ffffff;
}

.header-inner {
    max-width: 1380px;
    margin: 0 auto;
    padding: 0 35px 18px;

    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    display: block;
    width: auto;
    height: 68px;
}

.nav-row {
    width: 100%;
    margin-top: 18px;

    display: flex;
    justify-content: center;
}


/* ==========================================
   Navigation
   ========================================== */

.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 38px;
}

.main-nav a {
    color: #111111;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
}

.main-nav a:hover {
    color: #0875b9;
}


/* ==========================================
   Contenu
   ========================================== */

.main-content {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 30px;
}

h2 {
    margin-top: 0;
    color: #0875b9;
}


/* ==========================================
   Tableaux
   ========================================== */

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

th,
td {
    padding: 11px 14px;
    border: 1px solid #d8d8d8;
    text-align: left;
}

th {
    background: #0875b9;
    color: #ffffff;
    font-weight: 600;
}

tr:nth-child(even) {
    background: #f5f8fa;
}


/* ==========================================
   Liens
   ========================================== */

a {
    color: #0875b9;
}

a:hover {
    color: #d71920;
}


/* ==========================================
   Pied de page
   ========================================== */

.site-footer {
    max-width: 1100px;
    margin: 60px auto 0;
    padding: 20px 30px;

    border-top: 1px solid #dddddd;

    color: #666666;
    font-size: 14px;
}

/* ==========================================
   Accueil
   ========================================== */

.home-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 35px;
}

.home-card {
    display: block;
    padding: 25px;
    background: #ffffff;
    border: 1px solid #dddddd;
    border-top: 4px solid #0875b9;

    color: #222222;
    text-decoration: none;

    transition: box-shadow 0.2s ease,
                transform 0.2s ease;
}

.home-card:hover {
    color: #222222;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.home-card h3 {
    margin-top: 0;
    color: #0875b9;
}

.home-card p {
    margin-bottom: 0;
    color: #555555;
}

/* ==========================================
   Retour accueil
   ========================================== */

.back-home {
    display: inline-block;
    margin-bottom: 25px;

    color: #0875b9;
    text-decoration: none;
    font-weight: 600;
}

.back-home:hover {
    color: #d71920;
}

/* ==========================================
   Formulaires
   ========================================== */

.form-selection label {
    margin-right: 5px;
}

.form-selection select {
    margin-right: 20px;
    padding: 8px 10px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    background-color: #ffffff;
    font-size: 16px;
    height: 40px;
    box-sizing: border-box;
}

.form-row {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group label {
    font-weight: 600;
}

.form-group select {
    min-width: 180px;
    padding: 9px 10px;
    border: 1px solid #cccccc;
    border-radius: 3px;
    background: #ffffff;
    font-size: 16px;
}

button {
    padding: 10px 22px;
    border: none;
    border-radius: 3px;
    background: #0875b9;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
}

button:hover {
    background: #d71920;
}

a.button {
    display: inline-block;
    padding: 10px 22px;
    border: none;
    border-radius: 3px;
    background: #0875b9;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
}

a.button:hover {
    background: #d71920;
}

.ventes-titre {
    margin-top: 40px;
}

.ventes-table th {
    text-align: center;
    vertical-align: middle;
}

.ventes-table th:first-child {
    text-align: left;
}

.ventes-table td {
    vertical-align: middle;
}

.ventes-table .station-row td {
    background: #e9f3f9;
    color: #0875b9;
    font-size: 16px;
    padding: 9px 14px;
}

.ventes-table .station-multi td {
    background: #dcecf6;
}

.ventes-table .site-row td:first-child {
    font-weight: 600;
    padding-left: 28px;
}

.ventes-table td:not(:first-child) {
    text-align: center;
}

.ventes-table input.quantite {
    width: 90px;
    padding: 7px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    text-align: center;
    font-size: 16px;
}

.ventes-actions {
    margin: 20px 0;
    text-align: right;
}

.stations-table {
    margin-top: 25px;
}

.stations-table .station-row td {
    vertical-align: top;
}

.button-delete {
    padding: 3px 8px;
    font-size: 13px;
    background: #d71920;
}

.station-form {
    margin-bottom: 40px;
}

.station-form input[type="text"] {
    min-width: 250px;
    padding: 9px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 16px;
}

.erreur-montant {
    border: 2px solid #d71920;
    background-color: #fff0f0;
}

.message-success {
    margin: 20px 0;
    padding: 10px 14px;
    background: #eaf6ea;
    border: 1px solid #b7d8b7;
}

.message-error {
    margin: 20px 0;
    padding: 10px 14px;
    background: #fdeaea;
    border: 1px solid #e0b5b5;
}

.flash-message {
    width: 100%;
    margin: 15px 0;
    padding: 10px 15px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f5f5f5;
    color: #333;
    font-size: 15px;
}

.comite-form > div {
    margin-bottom: 15px;
}
.comite-form input[type="text"],
.comite-form input[type="email"] {
    width: 50%;
    padding: 9px 10px;
    border: 1px solid #cccccc;
    border-radius: 3px;
    font-size: 16px;
}
.comite-form label {
    font-weight: 600;
}

/* ==========================================
   Facturation
   ========================================== */

.ligne-formulaire {
    display: flex;
    align-items: flex-end;
    gap: 25px;
    margin-bottom: 30px;
}

.ligne-formulaire > div {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.ligne-formulaire label {
    font-weight: 600;
}

.ligne-formulaire select {
    width: 190px;
    padding: 9px 10px;
    border: 1px solid #cccccc;
    border-radius: 3px;
    background: #ffffff;
    font-size: 16px;
}

.ligne-formulaire button {
    height: 40px;
}

/* ==========================================================
   FACTURATION
   ========================================================== */

.facture {
    width: 100%;
    max-width: 650px;
    margin-top: 25px;
    margin-bottom: 50px;
}

.facture h2 {
    color: #0879bd;
    font-size: 24px;
    margin: 0 0 18px 0;
}

/* Nom du produit */
.facture-produit-titre {
    font-size: 16px;
    font-weight: bold;
    margin-top: 18px;
    margin-bottom: 4px;
}

/* Ligne d'une composante */
.facture-ligne {
    display: grid;
    grid-template-columns: 1fr 80px 140px;
    align-items: center;
    min-height: 27px;
}

.facture-designation {
    padding-left: 30px;
}

.facture-quantite {
    text-align: right;
    padding-right: 20px;
}

.facture-montant {
    text-align: right;
    padding-right: 10px;
}

/* Sous-total d'une rubrique */
.facture-sous-total {
    display: grid;
    grid-template-columns: 1fr 140px;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid #cccccc;
    font-weight: bold;
}

.facture-sous-total strong {
    text-align: right;
    padding-right: 10px;
}

/* Total général */
.facture-total {
    display: grid;
    grid-template-columns: 1fr 140px;
    margin-top: 25px;
    padding-top: 10px;
    border-top: 2px solid #0879bd;
    font-size: 18px;
    font-weight: bold;
}

.facture-total strong {
    text-align: right;
    padding-right: 10px;
}

/* ==========================================================
   BOUTON DOCX FACTURATION
   ========================================================== */

.button-docx {
    display: inline-block;
    padding: 9px 18px;
    background-color: #0879bd;
    color: white;
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
    border: 1px solid #0879bd;
    cursor: pointer;
}

.button-docx:hover {
    background-color: #06669f;
    border-color: #06669f;
}

.form-selection label {
    margin-right: 5px;
}

.form-selection select {
    margin-right: 20px;
}

/* ==========================================================
   Suivi des saisies
   ========================================================== */

.button-print {
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 9px 18px;
    background-color: #0879bd;
    color: white;
    border: 1px solid #0879bd;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
}

.button-print:hover {
    background-color: #06669f;
    border-color: #06669f;
}

.titre-impression,
.periode-impression {
    display: none;
}


/* ==========================================================
   Impression
   ========================================================== */

@media print {

    nav,
    .form-selection,
    .button-print,
    .back-link,
    footer {
        display: none !important;
    }

    body {
        margin: 0;
        padding: 0;
    }

    .suivi-saisies-page {
        width: 100%;
    }

    .titre-impression {
        display: block;
        margin-bottom: 5px;
        font-size: 20pt;
    }

    .periode-impression {
        display: block;
        margin-top: 0;
        margin-bottom: 20px;
        font-size: 12pt;
    }

    .tableau {
        width: 100%;
    }

    .tableau th {
        background-color: #0879bd !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

}

.button-fiche {
    display: inline-block;
    padding: 5px 10px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    font-size: 0.9em;
    border-radius: 4px;
    border: 1px solid #6c757d;
}

.button-fiche:hover {
    background-color: #5a6268;
    border-color: #5a6268;
    color: white;
    text-decoration: none;
}

.button-repartition {
    display: inline-block;
    padding: 5px 10px;
    background-color: #0879bd;
    color: white;
    text-decoration: none;
    font-size: 0.9em;
    border-radius: 4px;
    border: 1px solid #0879bd;
}

.button-repartition:hover {
    background-color: #06669f;
    border-color: #06669f;
    color: white;
    text-decoration: none;
}

.station-search {
    margin: 20px 0;
}

.station-search label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.station-search input {
    width: 300px;
    max-width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

/* ==========================================================
   DISTRIBUTEURS
   ========================================================== */

/* -------------------------
   Ajout d'un distributeur
   ------------------------- */

.distributeur-form {
    display: flex;
    align-items: center;
    gap: 5px;
}

.distributeur-form input[type="text"] {
    padding: 5px 10px;
    height: 32px;
    box-sizing: border-box;
    font-size: 0.9em;
    border: 1px solid #cccccc;
    border-radius: 4px;
}


/* -------------------------
   Fiche distributeur
   ------------------------- */

.distributeur-fiche-form {
    max-width: 900px;
}

.distributeur-fiche-form .form-group {
    margin-bottom: 15px;
}

.distributeur-fiche-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.distributeur-fiche-form input[type="text"],
.distributeur-fiche-form input[type="email"] {
    width: 100%;
    max-width: 600px;
    height: 38px;
    padding: 7px 10px;
    border: 1px solid #cccccc;
    border-radius: 3px;
    font-size: 16px;
    box-sizing: border-box;
}

.distributeur-fiche-form .form-row {
    display: flex;
    gap: 30px;
    margin-bottom: 0;
}

.distributeur-fiche-form .form-row .form-group {
    flex: 1;
}

.distributeur-fiche-form h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: #0875b9;
}

.distributeur-fiche-form button[type="submit"] {
    padding: 9px 18px;
    background-color: #0879bd;
    color: #ffffff;
    border: 1px solid #0879bd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
}

.distributeur-fiche-form button[type="submit"]:hover {
    background-color: #06669f;
    border-color: #06669f;
}

.distributeur-fiche-form .button-secondary {
    display: inline-block;
    margin-left: 10px;
    padding: 9px 18px;
    background-color: #6c757d;
    color: #ffffff;
    text-decoration: none;
    border: 1px solid #6c757d;
    border-radius: 4px;
    font-size: 15px;
}

.distributeur-fiche-form .button-secondary:hover {
    background-color: #5a6268;
    border-color: #5a6268;
    color: #ffffff;
    text-decoration: none;
}

.button-repartition-club {
    display: inline-block;
    padding: 5px 10px;
    background-color: #198754;
    color: white;
    text-decoration: none;
    font-size: 0.9em;
    border-radius: 4px;
    border: 1px solid #198754;
}

.button-repartition-club:hover {
    background-color: #157347;
    border-color: #157347;
    color: white;
    text-decoration: none;
}

/* ==========================================================
   CLUBS
   ========================================================== */

/* -------------------------
   Page Clubs
   ------------------------- */

.clubs-form {
    margin-bottom: 25px;
}

.clubs-form input[type="text"] {
    min-width: 250px;
    padding: 9px 10px;
    border: 1px solid #cccccc;
    border-radius: 3px;
    font-size: 16px;
}

.club-search {
    margin: 20px 0;
}

.club-search label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.club-search input[type="text"] {
    width: 300px;
    max-width: 100%;
    padding: 8px 10px;
    border: 1px solid #cccccc;
    border-radius: 3px;
    font-size: 16px;
    box-sizing: border-box;
}

.clubs-table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
}

.clubs-table th,
.clubs-table td {
    padding: 8px 10px;
    border: 1px solid #dddddd;
    text-align: left;
    vertical-align: middle;
}

.clubs-table th {
    background-color: #0875b9;
    color: #ffffff;
    font-weight: 600;
}

.clubs-table .club-row:hover {
    background-color: #f5f8fa;
}

/* -------------------------
   Répartition Club
   ------------------------- */

.club-repartition {
    max-width: 900px;
}

.club-repartition-recherche {
    margin: 25px 0;
    position: relative;
}

.club-repartition-recherche label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
}

.club-repartition-recherche input {
    width: 500px;
    max-width: 100%;
    height: 38px;
    padding: 7px 10px;
    border: 1px solid #cccccc;
    border-radius: 3px;
    font-size: 16px;
    box-sizing: border-box;
}

.club-resultats {
    width: 500px;
    max-width: 100%;
    border: 1px solid #cccccc;
    border-top: none;
    background: #ffffff;
}

.club-resultat {
    padding: 9px 10px;
    border-top: 1px solid #eeeeee;
    cursor: pointer;
}

.club-resultat:hover {
    background-color: #f5f8fa;
}

.club-repartition-table {
    width: 100%;
    max-width: 800px;
    margin-top: 15px;
    border-collapse: collapse;
}

.club-repartition-table th,
.club-repartition-table td {
    padding: 9px 10px;
    border: 1px solid #dddddd;
    vertical-align: middle;
}

.club-repartition-table th {
    background-color: #0875b9;
    color: #ffffff;
}

.club-repartition-table input[type="number"] {
    width: 90px;
    height: 36px;
    padding: 5px 8px;
    border: 1px solid #cccccc;
    border-radius: 3px;
    font-size: 16px;
    text-align: right;
    box-sizing: border-box;
}

.club-repartition-total {
    width: 800px;
    max-width: 100%;
    margin-top: 20px;
    padding: 12px 10px;
    border-top: 2px solid #0875b9;
    text-align: right;
    font-size: 18px;
}

.club-actif-form {
    display: inline-block;
    margin-left: 10px;
}

.club-actif-form label {
    cursor: pointer;
}


/* -------------------------
   Fiche Club
   ------------------------- */

.club-form {
    max-width: 900px;
}

.club-form .form-group {
    margin-bottom: 15px;
}

.club-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.club-form input[type="text"],
.club-form input[type="email"] {
    width: 100%;
    max-width: 600px;
    height: 38px;
    padding: 7px 10px;
    border: 1px solid #cccccc;
    border-radius: 3px;
    font-size: 16px;
    box-sizing: border-box;
}

.club-form .form-row {
    display: flex;
    gap: 30px;
    margin-bottom: 0;
}

.club-form .form-row .form-group {
    flex: 1;
}

.club-form h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: #0875b9;
}

.club-form button[type="submit"] {
    padding: 9px 18px;
    background-color: #0879bd;
    color: #ffffff;
    border: 1px solid #0879bd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
}

.club-form button[type="submit"]:hover {
    background-color: #06669f;
    border-color: #06669f;
}

.club-form .button-secondary {
    display: inline-block;
    margin-left: 10px;
    padding: 9px 18px;
    background-color: #6c757d;
    color: #ffffff;
    text-decoration: none;
    border: 1px solid #6c757d;
    border-radius: 4px;
    font-size: 15px;
}

.club-form .button-secondary:hover {
    background-color: #5a6268;
    border-color: #5a6268;
    color: #ffffff;
    text-decoration: none;
}

/* ==========================================================
   Statistiques
   ========================================================== */

.statistiques-produit {
    margin-top: 30px;
}

.statistiques-produit h3 {
    margin-bottom: 10px;
}

.statistiques-actions {
    margin: 20px 0 25px 0;
}

.table-scroll {
    overflow-x: auto;
    width: 100%;
}

.table-statistiques {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
    font-size: 14px;
}

.table-statistiques th,
.table-statistiques td {
    border: 1px solid #d8d8d8;
    padding: 7px 9px;
    text-align: right;
    white-space: nowrap;
}

.table-statistiques thead th {
    background-color: #0879BD;
    color: #ffffff;
    text-align: center;
}

.table-statistiques tbody th {
    text-align: left;
    background-color: #f2f5f7;
}

.table-statistiques tbody tr:nth-child(even) td {
    background-color: #f8fafb;
}

.table-statistiques .evolution {
    font-weight: 600;
}

.table-statistiques .indicateur {
    text-align: left;
    color: #333333;
    background-color: #ffffff;
    font-weight: bold;
}

.statistiques-total {
    margin-bottom: 40px;
}

.statistiques-total h3 {
    color: #0879BD;
}

/* =========================================================
   Parts Clubs reçues
   ========================================================= */

.parts-clubs-table {
    width: 100%;
    max-width: 900px;
    margin-top: 25px;
}

.parts-clubs-table th,
.parts-clubs-table td {
    padding: 10px 14px;
}

.parts-clubs-table th {
    text-align: center;
}

.parts-clubs-table .mois {
    text-align: left;
}

.parts-clubs-table .montant {
    text-align: center;
    white-space: nowrap;
}

.parts-clubs-table .evolution {
    text-align: center;
    white-space: nowrap;
}

.parts-clubs-table .total-row {
    font-weight: bold;
    border-top: 2px solid #0879BD;
}

.print-header {
    margin-top: 30px;
}

.print-header h2 {
    margin-bottom: 5px;
    color: #0879BD;
}

.print-saison {
    margin: 0;
    font-size: 18px;
}

.print-club {
    margin-top: 5px;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: bold;
    color: #D71945;
}


/* =========================================================
   Impression
   ========================================================= */

@media print {

    @page {
        size: A4 portrait;
        margin: 10mm;
    }

    body {
        background: #ffffff;
    }

    .form-selection,
    nav,
    header,
    footer,
    .no-print {
        display: none !important;
    }

    .page-header {
        display: none;
    }

    .print-header {
        margin-top: 0;
    }

    .print-header h2 {
        font-size: 20pt;
    }

    .print-saison {
        font-size: 13pt;
    }

    .print-club {
        font-size: 16pt;
    }

    .parts-clubs-table .club-nom {
    text-align: left;
    white-space: nowrap;
    }
    .parts-clubs-table {
        width: 100%;
        max-width: none;
        margin-top: 15px;
        font-size: 11pt;
    }

    .parts-clubs-table th,
    .parts-clubs-table td {
        padding: 6px 10px;
    }

}