body {
    font-family: Arial, sans-serif;
background:
    radial-gradient(
        circle at 10% 10%,
        rgba(37, 99, 235, 0.22),
        transparent 32%
    ),
    radial-gradient(
        circle at 90% 20%,
        rgba(168, 85, 247, 0.20),
        transparent 35%
    ),
    radial-gradient(
        circle at 70% 90%,
        rgba(6, 182, 212, 0.15),
        transparent 32%
    ),
    linear-gradient(
        135deg,
        #e7edf7 0%,
        #f8fafc 50%,
        #e6edf7 100%
    );

background-attachment: fixed;
}
h1 {
    margin-top: 0;
    color: #1f2937;
}

h2 {
    margin-top: 30px;
}

section {
    background: rgba(255, 255, 255, 0.68);

    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    border: 1px solid rgba(255, 255, 255, 0.85);

    border-radius: 18px;

    padding: 20px;
    margin-bottom: 20px;

    box-shadow:
        0 12px 35px rgba(15, 23, 42, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

form {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
}

input[type="file"] {
    margin-bottom: 15px;
}

button {
    background: #2563eb;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
}

button:hover {
    background: #1d4ed8;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
}

th,
td {
    border: 1px solid #d1d5db;
    padding: 8px 10px;
    text-align: left;
}

th {
    background: #f3f4f6;
    font-weight: bold;
}

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

hr {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 25px 0;
}

strong {
    color: #111827;
}

.resultat {
    border-left: 5px solid transparent;
}

.resultat.succes {
    border-left-color: #22c55e;
}

.resultat.erreur {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.stat {
    background: #f3f4f6;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
}

.stat-value {
    display: block;
    font-size: 26px;
    font-weight: bold;
    color: #111827;
}

.stat.nouveau {
    background: #eff6ff;
}

.stat.ajoute {
    background: #f0fdf4;
}

.stat.existant {
    background: #f8fafc;
}

.historique {
    margin-top: 15px;
    padding: 10px 14px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 14px;
}

.fichier-entete {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.fichier-titre {
    font-size: 20px;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 8px;
}

.fichier-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 25px;
    font-size: 14px;
    color: #6b7280;
}

.fichier-details strong {
    color: #374151;
}

.structure-ok {
    margin: 12px 0;
    font-weight: bold;
    color: #15803d;
}

.accueil {
    max-width: 900px;
    margin: 0 auto;
}

.accueil-intro {
    color: #6b7280;
    font-size: 17px;
    margin-bottom: 30px;
}

.menu-accueil {
    display: grid;
    gap: 18px;
}

.menu-carte {
    display: flex;
    align-items: center;
    gap: 20px;

    background: #ffffff;
    padding: 22px;

    border-radius: 10px;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);

    text-decoration: none;
    color: #222;

    transition: transform 0.15s, box-shadow 0.15s;
}

a.menu-carte:hover {
    transform: translateY(-2px);

    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.menu-icone {
    font-size: 38px;
    width: 55px;
    text-align: center;
}

.menu-carte h2 {
    margin: 0 0 6px 0;
    color: #1f2937;
}

.menu-carte p {
    margin: 0;
    color: #6b7280;
}

.menu-carte.indisponible {
    opacity: 0.6;
}

.bientot {
    display: inline-block;
    margin-top: 8px;

    font-size: 12px;
    font-weight: bold;

    background: #f3f4f6;
    padding: 4px 8px;

    border-radius: 5px;
    color: #6b7280;
}

.navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;

    width: calc(100% - 32px);
    max-width: none;
    margin: 0 auto 20px;
    box-sizing: border-box;
}

.navigation a {
    display: flex;
    flex: 1 1 135px;
    align-items: center;
    justify-content: center;

    min-height: 40px;
    padding: 8px 12px;
    box-sizing: border-box;

    background: #ffffff;
    color: #2563eb;

    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 8px;

    box-shadow:
        0 2px 6px rgba(15, 23, 42, 0.08);

    text-align: center;
    text-decoration: none;
    font-weight: bold;
    white-space: nowrap;
}

.navigation a:hover {
    background: #eff6ff;
    transform: translateY(-1px);
}

.navigation a.actif {
    background: #2563eb;
    color: #ffffff;

    box-shadow:
        0 4px 12px rgba(37, 99, 235, 0.25);
}


/* Onglets privés */

.navigation a.navigation-prive {
    background: #312e81;
    border-color: #312e81;
    color: #ffffff;

    box-shadow:
        0 3px 10px rgba(49, 46, 129, 0.25);
}

.navigation a.navigation-prive:hover {
    background: #4338ca;
}

.navigation a.navigation-prive.actif-prive {
    background: #7c3aed;
    border-color: #7c3aed;

    box-shadow:
        0 4px 14px rgba(124, 58, 237, 0.4);
}
.footer {
    max-width: 900px;
    margin: 40px auto 10px auto;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
    color: #9ca3af;
    font-size: 13px;
    text-align: center;
}

.repartition-circuit:last-child {
    border-bottom: none;
}

.message {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: bold;
}

.succes-message {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #15803d;
}

.erreur-message {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
}

.consommation-resultat {
    margin-top: 20px;
    padding: 18px;
    background: #f8fafc;
    border-radius: 8px;
}

.consommation-resultat h3 {
    margin-top: 0;
}

.consommation-valeur {
    font-size: 32px;
    font-weight: bold;
    margin: 10px 0;
}

.cycle-provisoire {
    color: #b45309;
    font-weight: bold;
}
.donnees-partielles,
.donnees-manquantes {
    margin-top: 15px;
    padding: 12px 15px;
    background: #fff7ed;
    border-radius: 8px;
    color: #9a3412;
}

.donnees-partielles {
    border: 1px solid #fdba74;
}

.donnees-manquantes {
    border: 1px solid #fb923c;
}

.donnees-manquantes p {
    margin: 8px 0;
}

.trou-detail {
    margin-top: 6px;
}

.form-tarif {
    display: flex;
    align-items: end;
    gap: 20px;
    flex-wrap: wrap;
}

.form-tarif label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-tarif input {
    width: 110px;
    padding: 7px;
}

/* =====================================================
   Alertes - Contrôle des données
   ===================================================== */

.alerte-controle {
    margin: 20px 0;
    padding: 18px 22px;
    border-radius: 8px;
    font-size: 1.05rem;
    line-height: 1.6;
    border: 2px solid;
}

.alerte-controle strong {
    display: inline-block;
    margin-bottom: 4px;
    font-size: 1.25rem;
}


/* Tout est normal */
.alerte-ok {
    background-color: #e8f5e9;
    border-color: #2e7d32;
    color: #1b5e20;
}


/* Anomalie importante */
.alerte-danger {
    background-color: #ffebee;
    border-color: #c62828;
    color: #b71c1c;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.12);
}


/* Information / coupure générale probable */
.alerte-attention {
    background-color: #fff3e0;
    border-color: #ef6c00;
    color: #e65100;
}

/* =====================================================
   Page graphiques
   ===================================================== */



.graphique-section {
    margin-top: 25px;
}

.graphique-entete {
    margin-bottom: 12px;
}

.graphique-entete h2 {
    margin-bottom: 4px;
}

.graphique-entete p {
    margin: 0;
    color: #64748b;
}


.graphique-carte {
    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #f8fafc 100%
        );

    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 20px;

    box-shadow:
        0 12px 32px
        rgba(15, 23, 42, 0.08);
}

.graphique-zone {
    position: relative;
    width: 100%;
    height: 420px;
    overflow: visible;
}

/* =====================================================
   Navigation entre circuits
   ===================================================== */

.navigation-circuits {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin: 20px 0 28px;
}

.circuit-fleche {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 46px;
    height: 46px;

    border: 1px solid #cbd5e1;
    border-radius: 50%;

    background: #ffffff;
    color: #1e293b;

    text-decoration: none;
    font-size: 2rem;
    line-height: 1;

    cursor: pointer;
}

.circuit-fleche:hover {
    background: #f1f5f9;
}

.circuit-actuel {
    min-width: 280px;
    text-align: center;
}

.circuit-actuel strong {
    display: block;
    font-size: 1.2rem;
}

.circuit-actuel span {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 0.9rem;
}

@media (max-width: 600px) {

    .navigation-circuits {
        gap: 10px;
    }

    .circuit-actuel {
        min-width: 0;
        flex: 1;
    }
}


/* =====================================================
   Graphiques - optimisation téléphone
   ===================================================== */

@media (max-width: 700px) {
	body:has(.page-graphiques) {
		padding: 4px;
	}
	    .navigation {
        display: none;
    }

    .page-graphiques h1 {
        display: none;
    }

    .page-graphiques > section:first-child {
        padding: 6px 10px;
        margin: 4px 0;
    }

    /* Utiliser presque toute la largeur de l'écran */
    main.page-graphiques {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 8px;
        box-sizing: border-box;
    }

    /* Cartes beaucoup moins volumineuses */
    .page-graphiques section {
        margin: 8px 0;
        padding: 14px;
        border-radius: 10px;
    }

    /* Navigation des circuits plus compacte */
    .page-graphiques .navigation-circuits {
        margin: 8px 0 2px;
        gap: 8px;
    }

    .page-graphiques .circuit-fleche {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
        font-size: 1.7rem;
    }

    .page-graphiques .circuit-actuel strong {
        font-size: 1.05rem;
    }

    .page-graphiques .circuit-actuel span {
        margin-top: 1px;
        font-size: 0.8rem;
    }

    /* Deuxième bloc : moins de vide */
    .page-graphiques .graphique-section {
        margin-top: 8px;
    }

    .page-graphiques .graphique-entete {
        margin-bottom: 8px;
    }

    .page-graphiques .graphique-entete h2 {
        margin: 0 0 3px;
        font-size: 1.35rem;
    }

    .page-graphiques .graphique-entete p {
        font-size: 0.9rem;
    }

    /* Carte du graphique quasiment pleine largeur */
    .page-graphiques .graphique-carte {
        padding: 8px;
        border-radius: 8px;
    }

    .page-graphiques .graphique-zone {
        height: 360px;
    }
}

.graphique-unite {
    margin: 0 0 2px 4px;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
}

/* =====================================================
   Mode Jour / Heure
   ===================================================== */

.graphique-modes {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.graphique-modes a {
    padding: 9px 20px;
    border-radius: 20px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    text-decoration: none;
}

.graphique-modes a.actif,
.graphique-affichage a.actif {
    background: #334155;
    border-color: #334155;
    color: #ffffff;
}


/* =====================================================
   Navigation par date
   ===================================================== */

.graphique-date-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 18px;
}

.graphique-date-form {
    margin: 0;
    padding: 0;
    background: none;
    box-shadow: none;
}

.graphique-date-form input[type="date"] {
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
}

.date-fleche {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    border: 1px solid #cbd5e1;
    border-radius: 50%;

    background: #ffffff;
    color: #1e293b;

    text-decoration: none;
    font-size: 1.7rem;
}
.date-fleche-desactivee {
    opacity: 0.3;
    cursor: default;
}
/* =====================================================
   Un circuit / Tous les circuits
   ===================================================== */

.graphique-affichage {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.graphique-affichage a {
    padding: 9px 18px;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    background: #ffffff;
    color: #334155;
    text-decoration: none;
    font-size: 0.95rem;
}


/* =====================================================
   Donut - répartition du mois
   ===================================================== */

.graphique-donut-carte {
    display: flex;
    justify-content: center;
    align-items: center;
}

.graphique-donut-zone {
    position: relative;

    width: min(100%, 700px);
    height: 390px;

    margin: 0 auto;
}

/* =====================================================
   Donut - données partielles et répartition facture
   ===================================================== */

.alerte-donut-partiel {
    margin: 0 0 16px;
    padding: 13px 16px;

    background: #fff7ed;
    border: 1px solid #fdba74;
    border-left: 5px solid #f97316;

    border-radius: 10px;

    color: #9a3412;
    line-height: 1.45;
}

.alerte-donut-partiel strong {
    font-weight: 700;
}

.alerte-donut-partiel > strong {
    display: block;
    margin-bottom: 3px;
}

/* =====================================================
   Curseur de répartition
   ===================================================== */

.repartition-slider-entete {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;

    margin-bottom: 5px;
}

.repartition-personne {
    display: flex;
}

.repartition-personne strong {
    font-size: 1rem;
}

.repartition-personne.damien {
    color: #A855F7;
}

.repartition-personne.gwen {
    color: #2563EB;
}

.curseur-repartition {
    width: 100%;
    height: 14px;

    appearance: none;
    -webkit-appearance: none;

    border-radius: 999px;

    background:
        linear-gradient(
            90deg,
            #A855F7 0%,
            #D946EF 35%,
            #3B82F6 65%,
            #2563EB 100%
        );

    outline: none;
    cursor: pointer;

    box-shadow:
        inset 0 1px 3px rgba(15, 23, 42, 0.25),
        0 0 0 2px rgba(148, 163, 184, 0.12);
}


.curseur-repartition::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;

    width: 30px;
    height: 30px;

    border-radius: 50%;

    background: #FACC15;

    border: 4px solid #ffffff;

    box-shadow:
        0 0 0 2px #334155,
        0 3px 10px rgba(15, 23, 42, 0.35),
        0 0 16px rgba(250, 204, 21, 0.65);

    cursor: grab;
}


.curseur-repartition::-moz-range-thumb {
    width: 22px;
    height: 22px;

    border-radius: 50%;

    background: #FACC15;

    border: 4px solid #ffffff;

    box-shadow:
        0 0 0 2px #334155,
        0 3px 10px rgba(15, 23, 42, 0.35),
        0 0 16px rgba(250, 204, 21, 0.65);

    cursor: grab;
}

/* =====================================================
   Répartition - affichage PC horizontal
   ===================================================== */

.page-repartition {
    width: calc(100% - 50px);
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}
.repartition-circuit {
    display: grid;
    grid-template-columns: 250px 1fr;
    align-items: center;
    gap: 24px;

    padding: 14px 0;

    border-bottom: 1px solid #e2e8f0;
}
.repartition-circuit.circuit-chambre-damien {
    --couleur-circuit: #A855F7;
}

.repartition-circuit.circuit-chambre-gwen {
    --couleur-circuit: #2563EB;
}

.repartition-circuit.circuit-etage-gwen {
    --couleur-circuit: #06B6D4;
}

.repartition-circuit.circuit-eau-chaude {
    --couleur-circuit: #F43F5E;
}

.repartition-circuit.circuit-cuisine-salon {
    --couleur-circuit: #10B981;
}

.repartition-circuit h3 {
    margin: 0;
    font-size: 1rem;
}
.form-repartition {
    display: grid;

    grid-template-columns:
        minmax(450px, 1fr)
        180px
        115px;

    align-items: center;
    gap: 22px;

    width: 100%;
    max-width: none;

    margin: 0;
    padding: 0;

    background: transparent;
    border-radius: 0;
    box-shadow: none;
}
.repartition-slider {
    width: 100%;
    max-width: none;

    margin: 0;
    padding: 0;

    background: transparent;
    box-shadow: none;
    border: none;
}

.repartition-personne {
    flex-direction: row;
    align-items: baseline !important;
    gap: 6px;
}

.repartition-personne span {
    font-size: 1.15rem;
    font-weight: 800;
}

.curseur-repartition {
    margin: 0;
}

.form-repartition button {
    width: 115px;
    margin: 0;
    padding: 10px 12px;

    white-space: nowrap;
}
.graphique-jour-selectionne {
    text-align: center;
    margin-bottom: 7px;

    font-size: 1.15rem;
    font-weight: 700;

    color: #334155;
}
/* =====================================================
   Fenêtre d'annotation du graphique
   ===================================================== */

.annotation-modal[hidden] {
    display: none;
}

.annotation-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.annotation-modal-contenu {
    width: min(420px, 100%);
    padding: 24px;

    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 18px;

    box-shadow:
        0 20px 60px rgba(15, 23, 42, 0.25);
}

.annotation-modal-contenu h3 {
    margin: 0 0 18px;
    font-size: 19px;
    color: #0f172a;
}

.annotation-modal-contenu input[type="text"] {
    box-sizing: border-box;
    width: 100%;
    padding: 12px 14px;

    font-size: 16px;

    border: 1px solid #cbd5e1;
    border-radius: 10px;
    outline: none;
}

.annotation-modal-contenu input[type="text"]:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.annotation-modal-boutons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 18px;
}

.annotation-modal-boutons button {
    padding: 10px 16px;

    border: 0;
    border-radius: 10px;

    font-size: 15px;
    cursor: pointer;
}

.annotation-modal-boutons button[type="submit"] {
    background: #4f46e5;
    color: white;
}

#annulerAnnotation {
    background: #e2e8f0;
    color: #334155;
}
/* =====================================================
   Liste des annotations existantes
   ===================================================== */

.annotations-existantes {
    margin-bottom: 18px;
    padding: 12px;

    background: rgba(79, 70, 229, 0.06);

    border: 1px solid rgba(79, 70, 229, 0.16);
    border-radius: 12px;
}

.annotations-existantes > strong {
    display: block;
    margin-bottom: 10px;

    font-size: 14px;
    color: #475569;
}

.annotation-existante-ligne {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    padding: 9px 0;

    border-bottom: 1px solid rgba(148, 163, 184, 0.20);
}

.annotation-existante-ligne:last-child {
    border-bottom: 0;
}

.annotation-existante-ligne > span {
    flex: 1;

    font-size: 14px;
    color: #1e293b;
}

.annotation-existante-actions {
    display: flex;
    gap: 6px;
}

.annotation-existante-actions button {
    padding: 5px 9px;

    border: 0;
    border-radius: 7px;

    font-size: 12px;
    cursor: pointer;
}

.annotation-existante-actions button:first-child {
    background: #e0e7ff;
    color: #4338ca;
}

.annotation-existante-actions button:last-child {
    background: #fee2e2;
    color: #b91c1c;
}

/* =====================================================
   Barre compacte des commandes du graphique
   ===================================================== */

.graphique-commandes {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 18px;
    width: 100%;
    margin-bottom: 18px;
}

.graphique-commandes .graphique-affichage,
.graphique-commandes .graphique-modes {
    align-items: center;
    margin: 0;
}

/* Écrans plus étroits */
@media (max-width: 900px) {

    .graphique-commandes {
        justify-content: center;
    }
}

/* =====================================================
   Info-bulle externe du graphique
   ===================================================== */

.graphique-tooltip-externe {
    position: absolute;
    z-index: 50;

    min-width: 260px;
    max-width: min(430px, calc(100vw - 30px));

    padding: 12px;

    background: rgba(15, 23, 42, 0.96);
    color: #e2e8f0;

    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;

    box-shadow:
        0 8px 24px rgba(15, 23, 42, 0.22);

    font-size: 13px;
    line-height: 1.45;

    pointer-events: none;

    transform:
        translate(-50%, -100%);

    transition:
    opacity 0.08s ease,
    left 0.14s ease-out,
    top 0.14s ease-out;
}
.graphique-tooltip-externe::after {
    content: "";

    position: absolute;

    left:
		calc(
			50% + var(--decalage-fleche, 0px)
		);
    top: 100%;

    transform: translateX(-50%);

    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid rgba(15, 23, 42, 0.96);
}

.graphique-tooltip-externe[hidden] {
    display: none;
}
/* =====================================================
   Sélecteur du mois du graphique
   ===================================================== */

.graphique-mois-selecteur {
    min-width: 190px;
    padding: 10px 14px;

    border: 1px solid #cbd5e1;
    border-radius: 12px;

    background: #ffffff;
    color: #0f172a;

	font-family: inherit;
	font-size: 21px;
	font-weight: 700;

    text-align: center;

    cursor: pointer;
}

/* =====================================================
   Défilement horizontal du graphique sur téléphone
   ===================================================== */

.graphique-defilement-mobile {
    width: 100%;
}


@media (max-width: 700px) {

    .graphique-defilement-mobile {
        max-width: 100%;

        overflow-x: auto;

        -webkit-overflow-scrolling: touch;

        overscroll-behavior-x: contain;
    }


    .graphique-defilement-mobile .graphique-zone {
        width:
            max(
                100%,
                var(--largeur-graphique-mobile)
            );

        min-width:
            max(
                100%,
                var(--largeur-graphique-mobile)
            );
    }


    .graphique-defilement-mobile canvas {
        touch-action: pan-x pan-y;
    }
}
/* =====================================================
   Conteneur visible de l'infobulle
   ===================================================== */

.graphique-zone-conteneur {
    position: relative;
    width: 100%;
}
/* =====================================================
   Légende fixe du graphique sur téléphone
   ===================================================== */

.graphique-legende-mobile {
    display: none;
}


@media (max-width: 700px) {

    .graphique-legende-mobile {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;

        gap: 8px 14px;

        margin-top: 12px;
        padding: 4px 4px 2px;
    }


    .graphique-legende-mobile-item {
        display: inline-flex;
        align-items: center;

        gap: 6px;

        margin: 0;
        padding: 3px 0;

        border: 0;
        background: transparent;

        color: #475569;

        font-size: 13px;
        line-height: 1.2;

        white-space: nowrap;
    }


    button.graphique-legende-mobile-item {
        cursor: pointer;
    }


    .graphique-legende-mobile-puce {
        width: 11px;
        height: 11px;

        flex: 0 0 11px;

        border-radius: 2px;
    }


    .graphique-legende-mobile-item.masque {
        opacity: 0.35;
    }


    .graphique-legende-mobile-info {
        width: 100%;
        justify-content: center;

        margin-top: 2px;
    }


    .graphique-legende-mobile-puce-incomplete {
        box-sizing: border-box;

        background: rgba(245, 158, 11, 0.18);

        border: 2px dashed #f59e0b;
    }
}
/* =====================================================
   Légende HTML du donut
   ===================================================== */

.legende-donut-mobile {
    width: 100%;
    margin-top: 16px;
}

.legende-donut-ligne {
    display: grid;

    grid-template-columns:
        12px
        minmax(120px, 1fr)
        minmax(150px, auto)
        auto;

    grid-template-areas:
        "puce nom repartition montant";

    align-items: center;

    gap: 8px 12px;

    padding: 8px 4px;

    font-size: 14px;

    color: #334155;
}

.legende-donut-puce {
    grid-area: puce;

    width: 11px;
    height: 11px;

    border-radius: 50%;
}

.legende-donut-nom {
    grid-area: nom;

    min-width: 0;
}

.legende-donut-repartition {
    grid-area: repartition;

    color: #64748b;
}

.legende-donut-montant {
    grid-area: montant;

    text-align: right;

    white-space: nowrap;

    color: #0f172a;

    font-variant-numeric:
        tabular-nums;
}

.legende-donut-separation {
    margin: 8px 0;

    border-top:
        1px solid #e2e8f0;
}

.legende-donut-personne {
    font-size: 15px;
}


/* =====================================================
   Téléphone
   ===================================================== */

@media (max-width: 700px) {

    .legende-donut-mobile {
        margin-top: 12px;
    }

    .legende-donut-ligne {

        grid-template-columns:
            12px
            minmax(0, 1fr)
            auto;

        grid-template-areas:
            "puce nom montant"
            ". repartition repartition";

        gap: 3px 8px;

        padding:
            8px 2px;
    }

    .legende-donut-repartition {
        font-size: 12px;
    }

    .legende-donut-montant {
        font-size: 14px;
    }

    .legende-donut-personne {
        padding-top: 9px;
        padding-bottom: 9px;
    }

    .graphique-donut-carte {
        flex-direction: column;
    }

    .graphique-donut-zone {
        height: 440px;
        flex: none;
    }
}
@media (min-width: 701px) {

    .legende-donut-mobile {
        flex: 0 1 760px;
        max-width: 760px;
        margin-left: 35px;
        margin-right: 25px;
    }

    .legende-donut-ligne {
        grid-template-columns:
            12px
            180px
            250px
            110px;

        justify-content: start;
    }
	
}
/* =====================================================
   Répartition - téléphone
   ===================================================== */

@media (max-width: 700px) {

    .page-repartition {
        width: 100%;
        max-width: none;
        padding: 0 12px;
        box-sizing: border-box;
    }

    .page-repartition section {
        padding: 16px;
    }

    .page-repartition .form-repartition {
		display: block;
		min-width: 0;
	}

	.page-repartition .repartition-slider {
		margin: 0 0 18px;
	}

    .page-repartition .form-repartition button {
        width: 100%;
    }
	
	.page-repartition .repartition-slider-entete {
		margin-bottom: 10px;
	}

	.page-repartition .repartition-personne {
		flex-direction: column;
		gap: 1px;
	}

	.page-repartition .repartition-personne.damien {
		align-items: flex-start !important;
	}

	.page-repartition .repartition-personne.gwen {
		align-items: flex-end !important;
	}

	.page-repartition .repartition-personne span {
    font-size: 1.25rem;
	}

	.page-repartition .repartition-circuit h3 {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 7px;

    margin: 0 0 18px;
	}

	.page-repartition .repartition-circuit-nom-principal {
		font-size: 1.35rem;
		font-weight: 800;
		color: #0f172a;
	}

	.page-repartition .repartition-circuit-numero {
		font-size: 0.75rem;
		font-weight: 500;
		color: #94a3b8;
	}
	.page-repartition .repartition-circuit {
		display: block;
		width: 100%;
		box-sizing: border-box;
		margin-bottom: 14px;
		padding: 16px;

		background:
			color-mix(in srgb, var(--couleur-circuit) 80%, white);

		border-left:
			5px solid
			var(--couleur-circuit, #cbd5e1);

		border-bottom: none;
		border-radius: 12px;

		box-shadow:
			0 3px 10px
			rgba(15, 23, 42, 0.05);
	}
	.page-repartition .curseur-repartition {
		touch-action: none;
	}
}
/* Estimation de la prochaine facture du donut */
.donut-facture-projetee {
    margin-top: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
}

.donut-facture-projetee-montant {
    color: #d97706;
    font-size: 21px;
}

/* =====================================================
   Prévision de la prochaine facture
   ===================================================== */

.prevision-facture {
    width: min(680px, 100%);
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #dbe4f0;
    border-radius: 16px;
    background: linear-gradient(
        135deg,
        #ffffff 0%,
        #f8fafc 100%
    );
    box-shadow:
        0 8px 24px
        rgba(15, 23, 42, 0.06);
}

.prevision-facture-titre {
    margin: 0 0 12px;
    color: #0f172a;
    font-size: 17px;
    font-weight: 800;
}

.prevision-facture-grille {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.prevision-facture-carte {
    min-width: 0;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #ffffff;
}

.prevision-facture-label {
    display: block;
    margin-bottom: 7px;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.prevision-facture-valeur {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #d97706;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
}

.prevision-facture-aide {
    display: block;
    margin-top: 7px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
}

.prevision-facture-fleche {
    display: inline-grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    place-items: center;
    box-sizing: border-box;
    border: 2px solid currentColor;
    border-radius: 50%;

}

.prevision-facture-fleche svg {
    display: block;
    width: 100%;
    height: 100%;
}

.tendance-forte-hausse {
    color: #dc2626;
    background: #fef2f2;
}

.tendance-hausse {
    color: #ea580c;
    background: #fff7ed;
}

.tendance-stable {
    color: #64748b;
    background: #f8fafc;
}

.tendance-baisse {
    color: #16a34a;
    background: #f0fdf4;
}

.tendance-forte-baisse {
    color: #15803d;
    background: #ecfdf5;
}

@media (max-width: 650px) {

    .prevision-facture {
        padding: 13px;
    }

    .prevision-facture-grille {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   Recherche dans les annotations
   ===================================================== */

.page-recherche {
    max-width: 1000px;
    margin: 0 auto;
}

.recherche-introduction,
.recherche-resultats-entete p {
    color: #64748b;
}

.recherche-formulaire {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 20px 0 0;
}

.recherche-champ {
    min-width: 0;
}

.recherche-champ label {
    display: block;
    margin-bottom: 6px;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
}

.recherche-champ input,
.recherche-champ select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
}

.recherche-champ small {
    display: block;
    margin-top: 5px;
    color: #64748b;
}

.recherche-mots,
.recherche-formulaire > button,
.recherche-dates {
    grid-column: 1 / -1;
}

.recherche-dates {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.recherche-dates.est-masquee {
    display: none;
}

.recherche-formulaire > button {
    justify-self: start;
}

.recherche-erreur {
    border: 1px solid #fca5a5;
    background: #fef2f2;
    color: #b91c1c;
    font-weight: 700;
}

.recherche-resultats-entete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.recherche-resultats-entete h2,
.recherche-resultats-entete p {
    margin: 0;
}

.recherche-total {
    min-width: 190px;
    padding: 14px 18px;
    border-radius: 12px;
    background: #eff6ff;
    text-align: right;
}

.recherche-total span {
    display: block;
    color: #64748b;
    font-size: 13px;
}

.recherche-total strong {
    display: block;
    margin-top: 4px;
    color: #1d4ed8;
    font-size: 23px;
}

.recherche-cartes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.recherche-carte-personne {
    padding: 18px;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.recherche-personne-nom {
    color: #334155;
    font-size: 15px;
    font-weight: 800;
}

.recherche-personne-kwh {
    margin-top: 8px;
    color: #1d4ed8;
    font-size: 27px;
    font-weight: 800;
}

.recherche-personne-pourcentage {
    margin-top: 3px;
    color: #475569;
    font-weight: 700;
}

.recherche-barre {
    display: block;
    width: 100%;
    height: 8px;
    margin: 13px 0;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    background: #e2e8f0;
    appearance: none;
    -webkit-appearance: none;
}

.recherche-barre::-webkit-progress-bar {
    border-radius: 999px;
    background: #e2e8f0;
}

.recherche-barre::-webkit-progress-value {
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #06b6d4);
}

.recherche-barre::-moz-progress-bar {
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #06b6d4);
}

.recherche-carte-personne dl {
    margin: 0;
}

.recherche-carte-personne dl div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 7px;
    color: #64748b;
    font-size: 13px;
}

.recherche-carte-personne dt,
.recherche-carte-personne dd {
    margin: 0;
}

.recherche-carte-personne dd {
    color: #0f172a;
    font-weight: 700;
}

.recherche-carte-personne.non-attribuee {
    background: #f8fafc;
}

.recherche-carte-personne.non-attribuee .recherche-personne-kwh {
    color: #64748b;
}

.recherche-carte-personne.non-attribuee .recherche-barre::-webkit-progress-value,
.recherche-carte-personne.non-attribuee .recherche-barre::-moz-progress-bar {
    background: #94a3b8;
}

.recherche-carte-personne.non-attribuee p,
.recherche-information {
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
}

.recherche-information {
    margin: 18px 0 0;
}

@media (max-width: 650px) {
    .page-recherche {
        padding: 0 12px;
    }

    .recherche-formulaire,
    .recherche-dates {
        grid-template-columns: 1fr;
    }

    .recherche-resultats-entete {
        align-items: stretch;
        flex-direction: column;
    }

    .recherche-total {
        text-align: left;
    }
}

.accueil-entete {
    text-align: center;
    margin-bottom: 28px;
}

.accueil-logo {
    display: block;
    width: 144px;
    height: 144px;
    margin: 0 auto 16px;
    border-radius: 30px;
}

.accueil-entete h1,
.accueil-entete .accueil-intro {
    text-align: center;
}
