/* Summer Rolls · Tâches obligatoires
   Palette : vert herbe profond, menthe, blanc riz, piment (alerte) */
:root {
  --vert: #16453A;
  --vert-fonce: #0C2E26;
  --menthe: #BFE8D2;
  --menthe-pale: #EAF7F0;
  --riz: #FBFAF5;
  --encre: #12211D;
  --gris: #6E7F79;
  --ligne: #DCE8E1;
  --piment: #D6453B;
  --piment-pale: #FDECEA;
  --soleil: #F2B84B;
  --r: 14px;
  font-size: 16px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--riz); color: var(--encre);
  font-family: 'Outfit', system-ui, sans-serif; line-height: 1.45;
}
h1, h2, h3, .marque { font-family: 'Space Grotesk', sans-serif; }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; color: var(--vert); }
a { color: var(--vert); }

/* ── Barre haute ─────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 1rem;
  background: var(--vert); color: #fff; padding: .6rem 1rem;
  position: sticky; top: 0; z-index: 20;
}
.marque { color: #fff; text-decoration: none; font-weight: 700; display: flex; align-items: center; gap: .5rem; flex: 1; }
.marque-rond { width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(135deg, var(--menthe), var(--soleil)); flex: none; }
.nav { display: flex; gap: .25rem; }
.nav a {
  color: #DFF0E7; text-decoration: none; padding: .45rem .7rem; border-radius: 99px;
  white-space: nowrap; font-weight: 600; font-size: .92rem;
}
.nav a.on { background: rgba(255,255,255,.16); color: #fff; }
.profil-badge { color: #fff; text-decoration: none; display: flex; align-items: center; gap: .45rem; font-size: .9rem; order: 3; }
.pastille {
  width: 30px; height: 30px; border-radius: 9px; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 700; color: #fff; flex: none;
}
/* Hamburger — caché sur desktop */
.burger { display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; background: rgba(255,255,255,.12); border: 0; border-radius: 10px;
  cursor: pointer; padding: 0 10px; order: 4; }
.burger span { display: block; height: 2.5px; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }
.burger.actif span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.burger.actif span:nth-child(2) { opacity: 0; }
.burger.actif span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: .6rem; }
  .burger { display: flex; }
  .marque { flex: 1; }
  /* menu déroulant plein largeur */
  .nav { display: none; order: 5; flex-basis: 100%; flex-direction: column; gap: .2rem; padding-top: .4rem; }
  .nav.ouvert { display: flex; }
  .nav a { padding: .8rem 1rem; border-radius: 10px; font-size: 1rem; }
  .nav a.on { background: rgba(255,255,255,.18); }
}

.page { max-width: 1080px; margin: 0 auto; padding: 1.25rem 1rem 4rem; }
.sous-titre { color: var(--gris); margin: 0 0 1rem; }

/* ── Cartes / blocs ──────────────────────── */
.carte {
  background: #fff; border: 1px solid var(--ligne); border-radius: var(--r);
  padding: 1rem; margin-bottom: 1rem;
}
.zone-titre {
  display: flex; align-items: center; gap: .5rem; margin: 1.4rem 0 .6rem;
  font-family: 'Space Grotesk'; font-weight: 700; color: var(--vert);
  text-transform: uppercase; letter-spacing: .06em; font-size: .85rem;
}
.zone-titre::after { content: ''; flex: 1; height: 1px; background: var(--ligne); }

/* ── Formulaires ─────────────────────────── */
input, select, button { font: inherit; }
input[type=text], input[type=password], input[type=date], input[type=number], select {
  width: 100%; padding: .7rem .8rem; border: 1.5px solid var(--ligne);
  border-radius: 10px; background: #fff;
}
input:focus, select:focus, button:focus-visible { outline: 3px solid var(--menthe); border-color: var(--vert); }
label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: .3rem; }
.champ { margin-bottom: .9rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--vert); color: #fff; border: 0; border-radius: 12px;
  padding: .8rem 1.3rem; font-weight: 700; cursor: pointer; text-decoration: none;
  min-height: 48px;
}
.btn:active { transform: scale(.98); }
.btn.secondaire { background: var(--menthe-pale); color: var(--vert); border: 1.5px solid var(--menthe); }
.btn.danger { background: var(--piment); }
.btn.petit { min-height: 0; padding: .45rem .8rem; font-size: .88rem; border-radius: 9px; }

.msg-ok { background: var(--menthe-pale); border: 1px solid var(--menthe); color: var(--vert); padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; }
.msg-err { background: var(--piment-pale); border: 1px solid #F3C1BD; color: var(--piment); padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; }

/* ── Écran de connexion / profils ────────── */
.plein-ecran {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 2rem 1rem;
  background: linear-gradient(160deg, var(--vert-fonce), var(--vert) 60%, #1E5A4A);
  color: #fff;
}
.plein-ecran .boite { width: 100%; max-width: 380px; text-align: center; }
.plein-ecran h1 { font-size: 1.7rem; }
.plein-ecran .carte { color: var(--encre); text-align: left; }
.logo-texte { letter-spacing: .02em; }
.logo-texte em { color: var(--menthe); font-style: normal; }
.logo-img { width: 130px; height: 130px; max-width: 45vw; margin: 0 auto .6rem; display: block; filter: drop-shadow(0 8px 24px rgba(0,0,0,.25)); }
.accroche { margin: 0 0 .3rem; color: var(--menthe); }

.grille-profils {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem; width: 100%; max-width: 560px; margin-top: 1.5rem;
}
.tuile-profil {
  background: rgba(255,255,255,.07); border: 1.5px solid rgba(255,255,255,.15);
  border-radius: var(--r); padding: 1.1rem .6rem; text-align: center;
  color: #fff; cursor: pointer; text-decoration: none; transition: transform .1s;
}
.tuile-profil:hover { transform: translateY(-3px); border-color: var(--menthe); }
.tuile-profil .pastille { width: 56px; height: 56px; border-radius: 16px; font-size: 1.5rem; margin: 0 auto .6rem; }
.tuile-profil small { color: var(--menthe); }

/* Pavé PIN */
.pin-points { display: flex; gap: .8rem; justify-content: center; margin: 1rem 0 1.4rem; }
.pin-points span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--menthe); }
.pin-points span.plein { background: var(--menthe); }
.pave { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; max-width: 280px; margin: 0 auto; }
.pave button {
  background: rgba(255,255,255,.1); border: 1.5px solid rgba(255,255,255,.18);
  color: #fff; font-size: 1.4rem; font-weight: 700; border-radius: 14px;
  padding: .9rem 0; cursor: pointer; min-height: 58px;
}
.pave button:active { background: var(--menthe); color: var(--vert); }

/* ── Saisie des températures ─────────────── */
.ligne-eq {
  display: flex; align-items: center; gap: .8rem; padding: .8rem 0;
  border-bottom: 1px solid var(--ligne);
}
.ligne-eq:last-child { border-bottom: 0; }
.ligne-eq .infos { flex: 1; min-width: 0; }
.ligne-eq .nom { font-weight: 600; }
.ligne-eq .cible { color: var(--gris); font-size: .85rem; }
/* .ligne-eq .saisie-temp : spécificité > input[type=text] pour garder la largeur fixe */
.ligne-eq .saisie-temp {
  flex: none; width: 96px; text-align: center; font-size: 1.25rem; font-weight: 700;
  font-family: 'Space Grotesk'; padding: .55rem .4rem;
}
.saisie-temp.hors { border-color: var(--piment); background: var(--piment-pale); color: var(--piment); }
.saisie-temp.ok { border-color: var(--menthe); background: var(--menthe-pale); color: var(--vert); }
.etat-releve { font-size: .8rem; color: var(--gris); width: 86px; text-align: right; }
.etat-releve .fait { color: var(--vert); font-weight: 600; }

.bandeau-retro {
  background: #FFF7E8; border: 1px solid #F2DCAD; color: #7A5A12;
  padding: .6rem .9rem; border-radius: 10px; margin-bottom: 1rem; font-size: .92rem;
}

/* Sélecteur jour / créneau */
.barre-saisie { display: flex; gap: .7rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.barre-saisie .champ { margin: 0; flex: 1; min-width: 140px; }
.creneaux { display: flex; gap: .5rem; }
.creneaux label {
  flex: 1; text-align: center; border: 1.5px solid var(--ligne); border-radius: 10px;
  padding: .65rem .5rem; cursor: pointer; font-weight: 600; margin: 0; background: #fff;
}
.creneaux input { display: none; }
.creneaux input:checked + span { color: var(--vert); }
.creneaux label:has(input:checked) { border-color: var(--vert); background: var(--menthe-pale); }

/* ── Grilles mensuelles ──────────────────── */
.defile { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.mois { border-collapse: collapse; font-size: .82rem; min-width: 100%; }
table.mois th, table.mois td {
  border: 1px solid var(--ligne); padding: .35rem .45rem; text-align: center; background: #fff;
}
table.mois th { background: var(--menthe-pale); color: var(--vert); font-family: 'Space Grotesk'; position: sticky; left: auto; }
table.mois td.jour-col, table.mois th.jour-col { position: sticky; left: 0; z-index: 2; background: var(--riz); font-weight: 700; }
table.mois td.weekend { background: #F4F6F2; }
table.mois td.hors { color: var(--piment); font-weight: 700; background: var(--piment-pale); }
table.mois td.vide { color: #C4CFC9; }
table.mois td .qui { display: block; color: var(--gris); font-size: .68rem; font-weight: 400; }
td.coche { color: var(--vert); font-weight: 700; }

/* Cases nettoyage cliquables */
button.case {
  width: 40px; height: 40px; border-radius: 10px; border: 1.5px solid var(--ligne);
  background: #fff; cursor: pointer; font-size: 1rem;
}
button.case.faite { background: var(--vert); color: #fff; border-color: var(--vert); }
button.case:disabled { opacity: .35; cursor: not-allowed; }

.puce-freq { font-size: .7rem; padding: .15rem .5rem; border-radius: 99px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.puce-freq.quotidienne { background: var(--menthe-pale); color: var(--vert); }
.puce-freq.hebdomadaire { background: #EAF0FB; color: #2C4E9A; }
.puce-freq.mensuelle { background: #F6ECFB; color: #7A3E9D; }

/* ── Tableaux admin ──────────────────────── */
table.liste { width: 100%; border-collapse: collapse; }
table.liste th, table.liste td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--ligne); font-size: .92rem; }
table.liste th { color: var(--gris); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.etiquette { font-size: .78rem; padding: .18rem .55rem; border-radius: 99px; background: var(--menthe-pale); color: var(--vert); font-weight: 700; }
.etiquette.off { background: #EEE; color: var(--gris); }
.etiquette.retro { background: #FFF7E8; color: #7A5A12; }

.entete-page { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.nav-mois { display: flex; align-items: center; gap: .6rem; }
.nav-mois a { text-decoration: none; font-weight: 700; padding: .3rem .7rem; border: 1.5px solid var(--ligne); border-radius: 9px; background: #fff; }
.nav-mois strong { font-family: 'Space Grotesk'; }

/* Statut du jour (dashboard) */
.grille-statut { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.stat-num { font-family: 'Space Grotesk'; font-size: 2rem; font-weight: 700; color: var(--vert); }
.stat-num.alerte { color: var(--piment); }

@media (max-width: 640px) {
  .topbar { padding: .5rem .7rem; }
  .profil-badge span:not(.pastille) { display: none; }
  .page { padding: 1rem .7rem 4rem; }

  /* Tables (journal, archives) : défilement horizontal au lieu de couper le texte */
  .defile table.liste th, .defile table.liste td { white-space: nowrap; }

  /* Grille T° saisie : nom + cible en haut (pleine largeur), puis ± / valeur / relevé en dessous */
  .ligne-eq { flex-wrap: wrap; align-items: center; gap: .5rem .8rem; }
  .ligne-eq .infos { flex: 0 0 100%; width: 100%; min-width: 0; }
  .ligne-eq .saisie-groupe { flex: 0 0 auto; }
  .ligne-eq .etat-releve { flex: 1 1 auto; width: auto; text-align: right; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ═══ Parcours guidé (hub + saisie secteur) ═══ */
.hub-tete { margin-bottom: .5rem; }
.fil { margin: 0 0 .5rem; }
.fil a { text-decoration: none; font-weight: 600; }

/* Bandeau date / heure / créneau */
.bandeau-moment { padding: .8rem 1rem; }
.bandeau-moment.retro { border-color: #F2DCAD; background: #FFFBF2; }
.moment-ligne { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: center; }
.moment-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gris); font-weight: 700; }
.moment-val { font-family: 'Space Grotesk'; font-weight: 700; font-size: 1.05rem; color: var(--vert); background: none; border: 0; padding: 0; cursor: pointer; border-bottom: 2px dashed var(--menthe); }
.moment-val.fixe { border: 0; cursor: default; }
.creneaux-mini { display: inline-flex; gap: .3rem; }
.creneaux-mini a { text-decoration: none; font-weight: 700; padding: .2rem .6rem; border-radius: 8px; border: 1.5px solid var(--ligne); color: var(--gris); font-size: .9rem; }
.creneaux-mini a.on { background: var(--menthe-pale); color: var(--vert); border-color: var(--menthe); }
.retro-note { margin-top: .7rem; font-size: .9rem; color: #7A5A12; }
.retro-note a { font-weight: 700; }

/* Tuiles secteurs */
.grille-secteurs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem; margin-bottom: .5rem; }
.tuile-secteur {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .3rem;
  background: #fff; border: 1.5px solid var(--ligne); border-radius: var(--r);
  padding: 1.1rem 1rem; text-decoration: none; color: var(--encre); transition: transform .1s, border-color .1s;
  min-height: 118px;
}
.tuile-secteur:hover { transform: translateY(-3px); border-color: var(--vert); }
.tuile-secteur.fait { background: var(--menthe-pale); border-color: var(--menthe); }
.tuile-secteur .coche {
  position: absolute; top: .7rem; right: .7rem; width: 26px; height: 26px; border-radius: 50%;
  background: var(--vert); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem;
}
.ts-icone { font-size: 1.7rem; }
.ts-nom { font-family: 'Space Grotesk'; font-weight: 700; font-size: 1.05rem; }
.ts-etat { font-size: .85rem; color: var(--gris); }
.tuile-secteur.fait .ts-etat { color: var(--vert); font-weight: 600; }

/* Saisie secteur */
.unite { color: var(--gris); font-weight: 600; width: 28px; }
.temp-lecture { width: 108px; text-align: center; font-family: 'Space Grotesk'; font-weight: 700; font-size: 1.25rem; padding: .55rem 0; border-radius: 10px; }
.temp-lecture.ok { background: var(--menthe-pale); color: var(--vert); }
.temp-lecture.hors { background: var(--piment-pale); color: var(--piment); }

/* Lignes de tâches (nettoyage guidé) */
.ligne-tache {
  display: flex; align-items: center; gap: .9rem; background: #fff;
  border: 1.5px solid var(--ligne); border-radius: 12px; padding: .7rem .9rem; margin-bottom: .6rem;
}
.ligne-tache.faite { background: var(--menthe-pale); border-color: var(--menthe); }
.bascule {
  width: 44px; height: 44px; flex: none; border-radius: 11px; border: 2px solid var(--ligne);
  background: #fff; cursor: pointer; font-size: 1.2rem; color: #fff;
}
.bascule.faite { background: var(--vert); border-color: var(--vert); }
.bascule:disabled { opacity: .4; cursor: not-allowed; }
.lt-nom { font-weight: 600; }
.lt-qui { display: block; font-weight: 400; color: var(--gris); font-size: .8rem; }

/* ═══ Calendrier maison (jours complets en vert) ═══ */
.bandeau-moment { position: relative; }
.cal-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  background: #fff; border: 1px solid var(--ligne); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,.15); padding: .9rem; width: 300px; max-width: calc(100vw - 2rem);
}
.cal-tete { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.cal-tete strong { font-family: 'Space Grotesk'; color: var(--vert); }
.cal-nav { width: 34px; height: 34px; border-radius: 9px; border: 1.5px solid var(--ligne); background: #fff; font-size: 1.2rem; cursor: pointer; color: var(--vert); }
.cal-nav:hover { background: var(--menthe-pale); }
.cal-jours-sem, .cal-grille { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-jours-sem span { text-align: center; font-size: .72rem; font-weight: 700; color: var(--gris); padding-bottom: .2rem; }
.cal-jour {
  aspect-ratio: 1; border: 1.5px solid transparent; border-radius: 9px; background: var(--riz);
  cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--encre);
}
.cal-jour:hover:not(:disabled) { border-color: var(--vert); }
.cal-jour.complet { background: var(--vert); color: #fff; }
.cal-jour.sel { outline: 2px solid var(--soleil); outline-offset: 1px; }
.cal-jour.auj { border-color: var(--menthe); }
.cal-jour:disabled { opacity: .3; cursor: default; }
.cal-legende { margin-top: .7rem; font-size: .75rem; color: var(--gris); display: flex; align-items: center; gap: .4rem; }
.pastille-verte { width: 14px; height: 14px; border-radius: 4px; background: var(--vert); flex: none; }

/* Bouton ± pour saisie de valeurs négatives */
.saisie-groupe { display: flex; align-items: center; gap: .4rem; flex: none; }
.signe {
  width: 40px; height: 46px; flex: none; border: 1.5px solid var(--ligne); border-radius: 10px;
  background: var(--menthe-pale); color: var(--vert); font-size: 1.3rem; font-weight: 700; cursor: pointer;
}
.signe:hover { border-color: var(--vert); }
.signe:active { background: var(--menthe); }

/* Bouton d'ouverture du calendrier (grille températures) */
.champ-date {
  width: 100%; text-align: left; padding: .7rem .8rem; border: 1.5px solid var(--ligne);
  border-radius: 10px; background: #fff; cursor: pointer; font-weight: 600; color: var(--vert);
  font-family: 'Space Grotesk', sans-serif;
}
.champ-date:hover { border-color: var(--vert); }
