/* PoolPro : feuille de style unique, servie par l'appli (aucun fichier chargé depuis internet). */
:root {
  --bleu: #0b6fb8; --bleu-fonce: #08548c; --bleu-clair: #e6f1fa;
  --vert: #1f8a4c; --vert-clair: #e5f5ec; --orange: #b86a00; --orange-clair: #fff3dc;
  --rouge: #c0392b; --rouge-clair: #fdeceb; --violet: #6b46c1; --violet-clair: #f0ebfb;
  --gris: #5f6b7a; --gris-clair: #eef1f5; --fond: #f3f7fb; --texte: #1d2733; --bord: #d9e0e8;
  --rayon: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 17px;
  line-height: 1.45; color: var(--texte); background: var(--fond); }
a { color: var(--bleu); }
h1 { font-size: 1.45rem; margin: .3rem 0 .6rem; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
h3 { font-size: 1rem; margin: .8rem 0 .3rem; }
code { background: var(--gris-clair); padding: 0 .25rem; border-radius: 4px; font-size: .85em; }

/* Barre du haut */
.barre { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .4rem;
  background: var(--bleu); color: #fff; padding: .35rem .6rem; padding-top: max(.35rem, env(safe-area-inset-top)); }
.logo { color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; }
.menu { display: flex; gap: .2rem; overflow-x: auto; flex: 1; scrollbar-width: none; }
.menu::-webkit-scrollbar { display: none; }
.menu a { color: #fff; text-decoration: none; padding: .45rem .6rem; border-radius: 8px; white-space: nowrap; font-size: .92rem; }
.menu a.actif, .menu a:hover { background: rgba(255,255,255,.2); }
.sortie { margin: 0; }
.sortie .btn-lien { color: #fff; font-size: .85rem; padding: .3rem .4rem; text-decoration: none; border: 1px solid rgba(255,255,255,.5); border-radius: 8px; }

.page { max-width: 1100px; margin: 0 auto; padding: .8rem .7rem 6rem; }
.carte { background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon); padding: .9rem; margin-bottom: .8rem; }
.etroit { max-width: 440px; margin-left: auto; margin-right: auto; }
.centre-page { margin-top: 8vh; }
.titre-logo { font-size: 2rem; text-align: center; }
.vide { text-align: center; color: var(--gris); }
.discret { color: var(--gris); }
.petit { font-size: .85rem; }
.texte { white-space: pre-line; }
.entete-page { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.defile { overflow-x: auto; }

/* Formulaires : gros champs pour le téléphone */
.pile { display: flex; flex-direction: column; gap: .7rem; }
label { display: block; font-weight: 600; font-size: .95rem; }
input, select, textarea { display: block; width: 100%; margin-top: .25rem; font: inherit; font-size: 17px; padding: .65rem .7rem;
  border: 1.5px solid var(--bord); border-radius: 10px; background: #fff; color: var(--texte); min-height: 48px; }
textarea { min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--bleu-clair); border-color: var(--bleu); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; display: inline-block; margin: 0 .4rem 0 0; transform: scale(1.3); }
input.court { width: 6rem; display: inline-block; }
fieldset { border: 1px solid var(--bord); border-radius: 10px; margin: .6rem 0; padding: .6rem; }
legend { font-weight: 700; padding: 0 .3rem; }
details > summary { cursor: pointer; font-weight: 600; padding: .5rem 0; color: var(--bleu-fonce); }
.ligne-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .8rem; }
.ligne-form input, .ligne-form select { width: auto; flex: 1 1 10rem; margin: 0; }
.ligne-form label { display: flex; align-items: center; gap: .3rem; font-weight: 400; }
.en-ligne { display: inline; }
.grille-2, .grille-3 { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.grille-3 { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.case { font-weight: 400; display: flex; align-items: center; gap: .3rem; padding: .3rem 0; }
ul.cases { list-style: none; padding: 0; margin: 0; columns: 2 16rem; }
.mesure input { font-size: 1.6rem; font-weight: 700; text-align: center; min-height: 60px; }
.sous-titre { font-weight: 600; margin: .6rem 0 .2rem; }
.bloc-admin { background: var(--violet-clair); padding: .6rem; border-radius: 10px; margin-top: .6rem; }

/* Boutons-choix (aspect de l'eau, jours...) */
.choix-boutons { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.choix { position: relative; margin: 0; }
.choix input { position: absolute; opacity: 0; pointer-events: none; }
.choix span { display: inline-block; padding: .65rem 1rem; min-width: 3.2rem; text-align: center; border: 1.5px solid var(--bord);
  border-radius: 999px; background: #fff; font-weight: 600; cursor: pointer; }
.choix.petit span { padding: .5rem .6rem; min-width: 2.8rem; }
.choix input:checked + span { background: var(--bleu); color: #fff; border-color: var(--bleu); }
.choix input:focus-visible + span { outline: 3px solid var(--bleu-clair); }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; padding: .6rem 1rem; min-height: 46px;
  border: 1.5px solid var(--bleu); border-radius: 10px; background: #fff; color: var(--bleu); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; }
.btn-principal { background: var(--bleu); color: #fff; }
.btn-grand { min-height: 56px; font-size: 1.1rem; width: 100%; }
.btn.rouge { border-color: var(--rouge); color: var(--rouge); }
.btn-lien { background: none; border: 0; padding: 0; color: var(--bleu); font: inherit; cursor: pointer; text-decoration: underline; }
.btn-lien.rouge { color: var(--rouge); }
.actions-fixes { position: sticky; bottom: 0; display: grid; grid-template-columns: 3fr 2fr; gap: .5rem; padding: .6rem 0;
  padding-bottom: max(.6rem, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--fond) 25%); }
.actions-fixes .btn { padding-left: .4rem; padding-right: .4rem; white-space: nowrap; }

/* Messages */
.flash { padding: .7rem .9rem; border-radius: 10px; margin-bottom: .7rem; border: 1px solid; }
.flash ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.flash-success { background: var(--vert-clair); border-color: #b7e2c8; color: #165c34; }
.flash-error { background: var(--rouge-clair); border-color: #f3c3be; color: #8c241a; }
.flash-info, .flash-message { background: var(--bleu-clair); border-color: #bcd9f0; color: var(--bleu-fonce); }

/* Planning */
.semaine { display: grid; grid-template-columns: 1.6rem repeat(7, 1fr) 1.6rem; gap: .25rem; margin-bottom: .7rem; }
.jour { display: flex; flex-direction: column; align-items: center; padding: .35rem 0; border-radius: 10px; background: #fff;
  border: 1px solid var(--bord); text-decoration: none; color: var(--texte); font-size: .8rem; }
.jour.fleche { justify-content: center; font-size: 1.4rem; background: none; border: 0; }
.jour.auj { border-color: var(--bleu); }
.jour.choisi { background: var(--bleu); color: #fff; border-color: var(--bleu); }
.j-num { font-size: 1.1rem; font-weight: 700; }
.j-nb { font-size: .75rem; opacity: .8; }
.compteurs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .7rem; }
.liste-cartes { list-style: none; padding: 0; margin: 0; }
.tournee { padding: 0; border-left: 6px solid var(--bleu); }
.tournee-lien { display: flex; flex-direction: column; gap: .15rem; padding: .8rem .9rem; color: inherit; text-decoration: none; }
.tournee-haut { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.type-inter { color: var(--violet); font-weight: 600; }
.st-en_cours { border-left-color: var(--orange); }
.st-termine, .st-a_facturer, .st-facture { border-left-color: var(--vert); opacity: .8; }
.st-reporte, .st-annule { border-left-color: var(--gris); opacity: .6; }

/* Pastilles de statut */
.pastille { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap;
  background: var(--gris-clair); color: var(--gris); }
.p-a_faire { background: var(--bleu-clair); color: var(--bleu-fonce); }
.p-en_cours { background: var(--orange-clair); color: var(--orange); }
.p-termine { background: var(--vert-clair); color: var(--vert); }
.p-a_facturer { background: var(--violet-clair); color: var(--violet); }
.p-facture { background: var(--gris-clair); color: var(--vert); }
.p-reporte, .p-annule { background: var(--gris-clair); color: var(--gris); }

/* Fiche et formulaire de passage */
.entete-client h1 { margin-top: 0; }
.entete-client p { margin: .25rem 0; }
.note-acces { background: var(--orange-clair); padding: .3rem .5rem; border-radius: 8px; }
.precedent { background: var(--gris-clair); padding: .35rem .5rem; border-radius: 8px; font-size: .92rem; }
.produits { list-style: none; padding: 0; margin: 0; }
.produits li label { display: grid; grid-template-columns: 1fr 6.5rem; align-items: center; gap: .5rem; padding: .25rem 0;
  border-bottom: 1px solid var(--gris-clair); font-weight: 500; }
.produits li input { margin: 0; text-align: center; font-size: 1.2rem; }
.photo-btn { position: relative; display: flex; align-items: center; justify-content: center; min-height: 70px; border: 2px dashed var(--bleu);
  border-radius: 12px; color: var(--bleu); font-size: 1.1rem; cursor: pointer; background: var(--bleu-clair); }
.photo-btn::before { content: "📷 "; margin-right: .3rem; }
.photo-btn::after { content: attr(data-nb); margin-left: .4rem; font-size: .85rem; color: var(--vert); }
.photo-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; min-height: 0; }
.vignettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; margin-top: .7rem; }
.vignettes figure { margin: 0; }
.vignettes img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.vignettes figcaption { font-size: .8rem; display: flex; justify-content: space-between; }
dl.details { display: grid; grid-template-columns: 8.5rem 1fr; gap: .3rem .7rem; margin: .5rem 0; }
dl.details dt { color: var(--gris); }
dl.details dd { margin: 0; }

/* Tableaux */
.tableau { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tableau th, .tableau td { text-align: left; padding: .45rem .4rem; border-bottom: 1px solid var(--gris-clair); vertical-align: top; }
.tableau th { color: var(--gris); font-weight: 600; font-size: .82rem; }
.tableau tr.alerte td { background: var(--orange-clair); }
.tableau tr.eteint td { opacity: .5; }
.grille-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .6rem; margin-bottom: .8rem; }
.chiffre { display: flex; flex-direction: column; text-decoration: none; color: var(--texte); margin: 0; }
.chiffre b { font-size: 2rem; color: var(--bleu); }

@media (max-width: 520px) {
  .grille-2 { grid-template-columns: 1fr 1fr; }
  dl.details { grid-template-columns: 6.5rem 1fr; }
  .menu a { font-size: .85rem; padding: .4rem .45rem; }
  .tableau { font-size: .85rem; }
}

/* Accord RGPD (1re connexion) */
.texte-accord h1 { font-size: 1.25rem; }
.texte-accord h2 { font-size: 1.05rem; margin: 1rem 0 .3rem; }
.texte-accord ul, .texte-accord ol { padding-left: 1.2rem; }
.texte-accord li { margin-bottom: .35rem; }
.case-accord { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem; border: 1px solid var(--bord); border-radius: var(--rayon); }
.case-accord input { width: 1.4rem; height: 1.4rem; flex: none; margin-top: .1rem; }
.refus-accord { margin-top: .8rem; }
.texte-brut { white-space: pre-wrap; font: inherit; font-size: .9rem; }
.grille-boutons { display: flex; flex-wrap: wrap; gap: .5rem; }
