:root {
  --fond: #f3f1ec;
  --carte: #ffffff;
  --texte: #1d211f;
  --doux: #6b716d;
  --ligne: #e2dfd8;
  --vert: #2f6b4f;
  --vert-fonce: #1f2a24;
  --rouge: #c0392b;
  --rouge-fond: #fbe9e7;
  --jaune: #b7791f;
  --jaune-fond: #fdf3e1;
  --ok: #2f6b4f;
  --ok-fond: #e7f2ec;
  --rayon: 14px;
  --champ: #ffffff;
  --secondaire: #e9e6df;
  --vide: #e8e5de;
  --ombre: rgba(0,0,0,.05);
  --haut: env(safe-area-inset-top, 0px);
  --bas: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--fond); color: var(--texte); font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}
#entete {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + var(--haut)) 14px 10px;
  background: var(--vert-fonce); color: #fff;
}
#entete h1 { font-size: 19px; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icone-btn { background: none; border: 0; color: inherit; font-size: 30px; line-height: 1; padding: 0 6px; cursor: pointer; }
#entete-droite button { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 8px; padding: 6px 10px; font-size: 14px; }

main { padding: 14px 14px calc(90px + var(--bas)); max-width: 720px; margin: 0 auto; }

#barre {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex; background: var(--carte); border-top: 1px solid var(--ligne);
  padding-bottom: var(--bas);
}
#barre a {
  flex: 1; text-align: center; padding: 8px 0 7px; font-size: 12px;
  color: var(--doux); text-decoration: none; display: flex; flex-direction: column; gap: 2px;
}
#barre a span { font-size: 21px; }
#barre a.actif { color: var(--vert); font-weight: 600; }

.carte { background: var(--carte); border-radius: var(--rayon); padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 2px var(--ombre); }
.carte h2, .section-titre { font-size: 15px; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); }
.section-titre { margin: 20px 4px 8px; display: flex; justify-content: space-between; align-items: center; }
.section-titre button { text-transform: none; letter-spacing: 0; }

/* liste d'équipements */
.equip { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.vignette {
  width: 64px; height: 64px; border-radius: 12px; flex-shrink: 0; object-fit: cover;
  background: var(--fond); display: flex; align-items: center; justify-content: center; font-size: 30px;
}
.equip .infos { flex: 1; min-width: 0; }
.equip .nom { font-weight: 600; font-size: 17px; }
.equip .sous { color: var(--doux); font-size: 14px; margin-top: 2px; }
.pastilles { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.pastille { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 99px; }
.pastille.retard { background: var(--rouge-fond); color: var(--rouge); }
.pastille.bientot { background: var(--jaune-fond); color: var(--jaune); }
.pastille.ok { background: var(--ok-fond); color: var(--ok); }

/* détail */
.photo-grande { width: 100%; max-height: 300px; object-fit: cover; border-radius: var(--rayon); display: block; margin-bottom: 12px; background: #ddd; }
.photo-vide { height: 140px; display: flex; align-items: center; justify-content: center; font-size: 60px; background: var(--vide); border-radius: var(--rayon); margin-bottom: 12px; }
.grille { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: 15px; }
.grille .lbl { color: var(--doux); font-size: 13px; }
.compteur { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.compteur .val { font-size: 26px; font-weight: 700; }
.compteur .date { color: var(--doux); font-size: 13px; }

.tache { border-left: 4px solid var(--ok); padding: 10px 12px; }
.tache.retard { border-left-color: var(--rouge); }
.tache.bientot { border-left-color: var(--jaune); }
.tache .ligne1 { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.tache .nom { font-weight: 600; }
.tache .details { color: var(--doux); font-size: 14px; margin-top: 4px; }
.tache .actions { display: flex; gap: 8px; margin-top: 10px; }

.histo { display: flex; gap: 10px; }
.histo .date { color: var(--doux); font-size: 13px; min-width: 78px; }
.histo .titre { font-weight: 600; }
.histo .notes { color: var(--doux); font-size: 14px; white-space: pre-wrap; }
.histo img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }

/* boutons et formulaires */
button, .btn {
  font: inherit; border: 0; border-radius: 10px; padding: 11px 16px; cursor: pointer;
  background: var(--vert); color: #fff; font-weight: 600; text-decoration: none; display: inline-block; text-align: center;
}
button.secondaire, .btn.secondaire { background: var(--secondaire); color: var(--texte); }
button.danger { background: var(--rouge-fond); color: var(--rouge); }
button.petit { padding: 7px 12px; font-size: 14px; }
button.lien { background: none; color: var(--vert); padding: 4px 0; }
button.plein { width: 100%; }
button:disabled { opacity: .5; }

label { display: block; font-size: 14px; color: var(--doux); margin: 12px 0 4px; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 16px; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--ligne); background: var(--champ); color: var(--texte);
}
textarea { min-height: 80px; resize: vertical; }
.rangee { display: flex; gap: 10px; }
.rangee > * { flex: 1; min-width: 0; }
.aide { font-size: 13px; color: var(--doux); margin-top: 6px; }
.boutons { display: flex; gap: 10px; margin-top: 18px; }
.boutons > * { flex: 1; }

.choix-photo { display: flex; align-items: center; gap: 12px; }
.choix-photo img, .choix-photo .vignette { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; }

.modele-tache { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--ligne); }
.modele-tache:last-child { border-bottom: 0; }
.modele-tache input[type=checkbox] { width: 22px; height: 22px; flex-shrink: 0; }
.modele-tache .nom-t { flex: 1; font-size: 15px; }
.modele-tache input.mini { width: 88px; padding: 6px 8px; font-size: 14px; }
.modele-tache .unit { font-size: 12px; color: var(--doux); width: 34px; }

.modele-tache.modele { flex-direction: column; align-items: stretch; gap: 6px; }
.modele .haut { display: flex; gap: 10px; align-items: center; margin: 0; color: var(--texte); font-size: 15px; }
.modele .bas { display: flex; gap: 6px; align-items: center; padding-left: 32px; }
.modele .unit { width: auto; }

.vide { text-align: center; color: var(--doux); padding: 40px 20px; }
.vide .gros { font-size: 50px; }

/* connexion */
.connexion { max-width: 380px; margin: 30px auto; }
.connexion .logo { text-align: center; font-size: 56px; }
.connexion h2 { text-align: center; margin: 6px 0 20px; }

/* modale */
dialog {
  border: 0; border-radius: 18px; padding: 0; width: min(94vw, 480px); max-height: 88vh;
  box-shadow: 0 10px 40px rgba(0,0,0,.3);
}
dialog::backdrop { background: rgba(0,0,0,.45); }
#modale-form { padding: 18px; }
#modale-form h3 { margin: 0 0 6px; }

#toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + var(--bas)); z-index: 50;
  background: var(--vert-fonce); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 15px;
  max-width: 90vw; box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
#toast.erreur { background: var(--rouge); }

.code { font-family: ui-monospace, Consolas, monospace; font-size: 22px; letter-spacing: .1em; font-weight: 700; }

/* ---- V2 : liens de recherche */
.liens { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.liens .btn, .liens button { padding: 10px 8px; font-size: 14px; }
.modele-tache button.petit.secondaire { padding: 5px 9px; }

/* ---- V2 : fiche d'entretien */
.fiche { background: var(--carte); border-radius: var(--rayon); padding: 22px; color: var(--texte); }
.fiche header { display: flex; justify-content: space-between; gap: 16px; border-bottom: 3px solid var(--vert); padding-bottom: 12px; margin-bottom: 14px; }
.fiche header img { width: 140px; height: 105px; object-fit: cover; border-radius: 8px; }
.fiche h1 { margin: 2px 0 4px; font-size: 26px; }
.fiche h2 { font-size: 16px; color: var(--vert); margin: 22px 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.fiche-sur { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--doux); }
.fiche table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fiche-infos th { text-align: left; color: var(--doux); font-weight: normal; width: 40%; padding: 3px 0; }
.fiche-infos td { padding: 3px 0; }
.fiche-table th { text-align: left; font-size: 12px; text-transform: uppercase; color: var(--doux); border-bottom: 1px solid var(--ligne); padding: 6px 6px 6px 0; }
.fiche-table td { border-bottom: 1px solid var(--ligne); padding: 7px 6px 7px 0; vertical-align: top; }
.fiche-notes { color: var(--doux); white-space: pre-wrap; }
.fiche footer { margin-top: 22px; font-size: 12px; color: var(--doux); text-align: right; }

@media print {
  #entete, #barre, .no-print, #toast { display: none !important; }
  :root { --carte: #fff; --texte: #111; --doux: #555; --ligne: #ddd; --vert: #2f6b4f; }
  body { background: #fff; color: #111; }
  main { padding: 0; max-width: none; }
  .fiche { padding: 0; border-radius: 0; }
  .fiche-table tr { break-inside: avoid; }
}

/* ---- thème sombre */
:root[data-theme="sombre"] {
  --fond: #0f1311;
  --carte: #1a201d;
  --texte: #e8ebe9;
  --doux: #9aa39e;
  --ligne: #2c3430;
  --vert: #4fa27a;
  --vert-fonce: #111613;
  --rouge: #ff7b6b;
  --rouge-fond: #3a1d1a;
  --jaune: #f0b955;
  --jaune-fond: #3a2e17;
  --ok: #6cc59a;
  --ok-fond: #183026;
  --champ: #121715;
  --secondaire: #29312d;
  --vide: #222a26;
  --ombre: rgba(0,0,0,.4);
  color-scheme: dark;
}
:root[data-theme="sombre"] .vignette { background: #222a26; }
:root[data-theme="sombre"] dialog { background: var(--carte); color: var(--texte); }

/* ---- petits ajouts */
.opt { font-size: 12px; color: var(--doux); font-weight: normal; }
.pastille.neutre { background: var(--secondaire); color: var(--doux); }
img.ico { width: 1.25em; height: 1.25em; vertical-align: -0.25em; object-fit: contain; }
.vignette img.ico, .photo-vide img.ico { width: 1.4em; height: 1.4em; }
.segments { display: flex; gap: 6px; }
.segments button { flex: 1; background: var(--secondaire); color: var(--texte); padding: 10px 6px; font-size: 14px; }
.segments button.actif { background: var(--vert); color: #fff; }

/* ---- problèmes connus (IA) */
.ia-h { font-size: 14px; margin: 14px 0 6px; color: var(--doux); text-transform: uppercase; letter-spacing: .03em; }
.ia-item { padding: 8px 0; border-bottom: 1px solid var(--ligne); }
.ia-item:last-of-type { border-bottom: 0; }
.ia-item .ligne1 { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.ia-item button.petit { padding: 4px 9px; font-size: 13px; flex-shrink: 0; }
.ia-liste { margin: 0; padding-left: 20px; font-size: 15px; }
.ia-liste li { margin: 4px 0; }
.ia-sources { margin-top: 10px; font-size: 14px; }
.ia-sources summary { cursor: pointer; color: var(--vert); }
.ia-sources a { display: block; color: var(--vert); margin: 6px 0; word-break: break-word; }
.ia-attente { display: flex; align-items: center; gap: 10px; color: var(--doux); }
.roue { width: 18px; height: 18px; border: 3px solid var(--ligne); border-top-color: var(--vert); border-radius: 50%; animation: tourne 0.9s linear infinite; flex-shrink: 0; }
@keyframes tourne { to { transform: rotate(360deg); } }
.modele .bas { flex-wrap: wrap; row-gap: 6px; }
.modele-tache input.mini { width: 84px; }
.compteur .val { white-space: nowrap; font-size: 24px; }

/* ---- compteurs (odomètre / heures) */
.ligne-compteur { padding: 6px 0; border-top: 1px solid var(--ligne); }
.ligne-compteur:first-of-type { border-top: 0; }
.derniere { margin-top: 10px; padding: 10px 12px; background: var(--secondaire); border-radius: 10px; font-size: 15px; }
.segments button:disabled { opacity: .4; }
.apercu-lecture { margin-top: 12px; font-size: 15px; line-height: 1.5; }
.apercu-lecture:empty { display: none; }
.apercu-lecture.ok { padding: 10px 12px; border-radius: 10px; background: var(--ok-fond); }
.apercu-lecture.alerte { padding: 10px 12px; border-radius: 10px; background: var(--rouge-fond); color: var(--rouge); }
.journal { margin-top: 10px; font-size: 14px; }
.journal summary { cursor: pointer; color: var(--vert); padding: 4px 0; }
.ligne-journal { display: grid; grid-template-columns: 1fr auto 70px 28px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--ligne); }
.ligne-journal:last-child { border-bottom: 0; }
.ligne-journal .d { color: var(--doux); }
.ligne-journal .v { font-weight: 600; text-align: right; }
.ligne-journal .diff { color: var(--ok); text-align: right; font-size: 13px; }
.ligne-journal .diff.neg { color: var(--rouge); }
.details.prevision { color: var(--vert); }

/* ---- page d'équipement en onglets */
.eq-tete { display: flex; gap: 14px; align-items: center; margin: -14px -14px 0; padding: 14px; background: var(--carte); }
.eq-photo { width: 96px; height: 74px; border-radius: 12px; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--vide); font-size: 38px; }
.eq-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.eq-photo img.ico { width: 1.5em; height: 1.5em; }
.eq-infos { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.eq-infos .pastilles { margin: 0; }
.eq-modele { font-size: 14px; color: var(--doux); }
.eq-onglets {
  position: sticky; top: var(--haut-entete, 52px); z-index: 5;
  display: flex; margin: 0 -14px 12px; padding: 0 4px; background: var(--carte);
  border-bottom: 1px solid var(--ligne); overflow-x: auto; scrollbar-width: none;
}
.eq-onglets::-webkit-scrollbar { display: none; }
.eq-onglets a {
  flex: 1 1 auto; text-align: center; padding: 12px 4px 9px; font-size: 13px; color: var(--doux);
  text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap;
}
.eq-onglets a.actif { color: var(--vert); font-weight: 700; border-bottom-color: var(--vert); }
.badge { display: inline-block; min-width: 16px; margin-left: 3px; padding: 0 4px; border-radius: 99px; background: var(--jaune-fond); color: var(--jaune); font-size: 11px; font-weight: 700; }
.eq-corps .carte h2 { margin-bottom: 6px; }

.ligne-afaire { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--ligne); }
.ligne-afaire:last-of-type { border-bottom: 0; }
.ligne-afaire .txt { flex: 1; min-width: 0; }
.ligne-afaire .nom { font-weight: 600; }
.sous { font-size: 13px; color: var(--doux); }
.sous.retard { color: var(--rouge); }
.sous.bientot { color: var(--jaune); }
.sous .prevision, .prevision { color: var(--vert); }
.point { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--ok); }
.point.retard { background: var(--rouge); }
.point.bientot { background: var(--jaune); }
.voir-plus { display: block; margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--vert); text-decoration: none; }

.grille-compteurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tuile-compteur { margin-bottom: 0; }
.tuile-compteur .lbl { font-size: 13px; color: var(--doux); }
.tuile-compteur .val { font-size: 22px; font-weight: 700; margin: 2px 0; white-space: nowrap; }
.tuile-compteur .date { font-size: 12px; color: var(--doux); margin-bottom: 8px; }
.grille-compteurs + .journal, .grille-compteurs { margin-bottom: 12px; }
details.carte.journal { margin-top: 0; }

.lien-probleme { display: flex; gap: 10px; align-items: center; background: var(--jaune-fond); color: var(--jaune); font-weight: 600; text-decoration: none; }

.barre-filtres { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.segments.filtres { flex: 1; flex-wrap: wrap; }
.segments.filtres button { flex: 0 0 auto; padding: 8px 12px; border-radius: 99px; }
.titre-section { flex: 1; margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); }

.liste-taches { padding: 0; overflow: hidden; }
.ligne-tache { border-left: 4px solid var(--ok); border-bottom: 1px solid var(--ligne); }
.ligne-tache:last-child { border-bottom: 0; }
.ligne-tache.retard { border-left-color: var(--rouge); }
.ligne-tache.bientot { border-left-color: var(--jaune); }
.ligne-tache summary { display: flex; align-items: center; gap: 8px; padding: 11px 14px; cursor: pointer; list-style: none; }
.ligne-tache summary::-webkit-details-marker { display: none; }
.ligne-tache .txt { flex: 1; min-width: 0; }
.ligne-tache .nom { font-weight: 600; }
.ligne-tache[open] { background: var(--fond); }
.etat { font-size: 12px; font-weight: 700; color: var(--ok); flex-shrink: 0; }
.etat.retard { color: var(--rouge); }
.etat.bientot { color: var(--jaune); }
.deplie { padding: 0 14px 12px; }
.deplie .actions { display: flex; gap: 8px; margin-top: 10px; }

.annee { font-size: 13px; font-weight: 700; color: var(--doux); letter-spacing: .04em; margin: 14px 4px 6px; }
.visite-tete { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 4px; }
.visite-item { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--ligne); font-size: 15px; }
.visite-item:first-of-type { border-top: 0; }
.visite-item img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }

.liste-pieces { padding: 4px 14px; }
.ligne-piece { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--ligne); }
.ligne-piece:last-child { border-bottom: 0; }
.numero { font-family: ui-monospace, Consolas, monospace; font-size: 14px; color: var(--doux); }

/* ---- historique : modification et pièces jointes */
button.visite-item {
  width: 100%; background: none; color: var(--texte); font-weight: normal; text-align: left;
  border-radius: 0; padding: 8px 0; cursor: pointer;
}
button.visite-item:active { background: var(--fond); }
.visite-item .chevron { color: var(--doux); font-size: 22px; line-height: 1; }
.ajout-visite { display: block; margin-top: 4px; font-size: 14px; }
.liste-pj { display: flex; flex-wrap: wrap; gap: 10px; }
.liste-pj:empty::before { content: "Aucune pour l'instant."; font-size: 14px; color: var(--doux); }
.pj-ligne { position: relative; }
.pj-ligne button.lien { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; padding: 0;
  border-radius: 50%; background: var(--carte); box-shadow: 0 1px 4px rgba(0,0,0,.25); font-size: 13px; }
.pj { display: flex; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; background: var(--secondaire);
  align-items: center; justify-content: center; text-decoration: none; }
.pj img { width: 100%; height: 100%; object-fit: cover; }
.pj.pdf { flex-direction: column; font-size: 26px; color: var(--texte); }
.pj.pdf span { font-size: 10px; max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- documents */
.doc-lien { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: center; color: var(--texte); text-decoration: none; }
.doc-ico { font-size: 26px; }

/* ---- manuels proposés */
.candidat { padding: 10px 0; border-top: 1px solid var(--ligne); }
.candidat .ligne1 { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.candidat .actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.carte .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.apercu.attente { display: flex; align-items: center; justify-content: center; }

/* ---- photo cliquable */
.apercu-clic { position: relative; display: block; margin: 0; cursor: pointer; flex-shrink: 0; }
.eq-photo { position: relative; padding: 0; border: 0; cursor: pointer; overflow: visible; }
button.eq-photo { background: var(--vide); }
button.eq-photo img { border-radius: 12px; }
.badge-photo {
  position: absolute; right: -6px; bottom: -6px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--carte); box-shadow: 0 1px 4px rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.photo-modale { width: 100%; max-height: 60vh; object-fit: contain; border-radius: 12px; display: block; background: var(--vide); }
.btn.plein { display: block; width: 100%; box-sizing: border-box; }

/* ---- administration */
#entete { flex-wrap: wrap; }
#bandeau-admin { flex: 0 0 calc(100% + 28px); box-sizing: border-box; display: flex; align-items: center; gap: 8px; margin: 8px -14px -10px; padding: 8px 14px;
  background: #f0b955; color: #3a2a06; font-size: 14px; }
#bandeau-admin span { flex: 1; }
#bandeau-admin button { background: #3a2a06; color: #fff; padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.lien-admin { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.ligne-user { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--ligne); color: inherit; text-decoration: none; }
.ligne-user:last-of-type { border-bottom: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--ok-fond); color: var(--ok); display: flex;
  align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.avatar.grand { width: 52px; height: 52px; font-size: 22px; }
.chevron { color: var(--doux); font-size: 22px; line-height: 1; }
button.lien-equip { flex: 1; min-width: 0; background: none; color: var(--texte); font-weight: normal; text-align: left; padding: 0; }
.segments.filtres a.btn { text-align: center; border-radius: 99px; }
.encadre-jaune { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--jaune-fond); color: var(--texte); font-size: 14px; }
.mono { font-family: ui-monospace, Consolas, monospace; }

/* ---- papiers */
button.ligne-papier { width: 100%; background: none; color: var(--texte); font-weight: normal; text-align: left; border-radius: 0; }

/* ---- facture lue */
.travail { padding: 10px 0; border-bottom: 1px solid var(--ligne); display: flex; flex-direction: column; gap: 6px; }
.travail .haut { display: flex; gap: 8px; align-items: center; margin: 0; }
.travail input[type=checkbox], .piece-lue input { width: 22px; height: 22px; flex-shrink: 0; }
.travail .titre-travail { font-weight: 600; }
.travail .rangee { gap: 6px; }
.piece-lue { display: flex; gap: 8px; align-items: center; margin: 6px 0; color: var(--texte); font-size: 15px; }

/* ---- rappels à date fixe proposés à l'ajout d'un équipement */
.modele-saison { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--ligne); }
.modele-saison:last-child { border-bottom: 0; }
.modele-saison input[type=checkbox] { width: 22px; height: 22px; flex-shrink: 0; }
.modele-saison .nom-t { flex: 1; font-size: 15px; }
.modele-saison .unit { font-size: 12px; color: var(--doux); }

/* ---- entretiens en pause / choix des entretiens suivis */
.titre-pause { margin: 18px 4px 8px; }
.ligne-pause { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--ligne); }
.ligne-pause:last-child { border-bottom: 0; }
.ligne-pause .txt { flex: 1; min-width: 0; opacity: .6; }
.ligne-pause .nom { font-size: 15px; font-weight: 600; }
.ligne-pause .sous { font-size: 13px; color: var(--doux); }
.ligne-suivi { padding: 9px 0; border-bottom: 1px solid var(--ligne); }
.ligne-suivi:last-child { border-bottom: 0; }
.ligne-suivi label { display: flex; gap: 10px; align-items: flex-start; margin: 0; color: var(--texte); font-size: 15px; }
.ligne-suivi input[type=checkbox] { width: 22px; height: 22px; flex-shrink: 0; margin: 1px 0 0; }
.ligne-suivi .sous { display: block; font-size: 12px; color: var(--doux); }
.repartir { margin: 8px 0 0 32px; padding: 8px 10px; border-radius: 8px; background: var(--jaune-fond); }
.repartir label { font-size: 14px; margin-top: 6px; align-items: center; }

/* ---- barre du bas : « Ajouter » à gauche, en vert */
#barre a.ajouter { color: var(--vert); font-weight: 700; }
#barre a.ajouter .plus {
  width: 34px; height: 26px; margin: 0 auto; border-radius: 9px; background: var(--vert); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; line-height: 1;
}
#barre a.ajouter.actif .plus { box-shadow: 0 0 0 3px var(--ok-fond); }

/* ---- arrivée d'un nouvel utilisateur */
body.plein-ecran #entete { display: none; }
body.plein-ecran main { padding-bottom: calc(14px + var(--bas)); }
.accueil { display: flex; flex-direction: column; min-height: calc(100vh - 28px - var(--bas)); min-height: calc(100dvh - 28px - var(--bas)); }
.accueil-haut {
  margin: -14px -14px 0; padding: calc(56px + var(--haut)) 28px 32px; border-radius: 0 0 28px 28px;
  background: var(--vert-fonce); color: #fff; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.accueil-icone { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.accueil-haut h1 { margin: 8px 0 0; font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.accueil-haut p { margin: 0; font-size: 17px; line-height: 1.4; color: #d9e3dc; max-width: 270px; }
.accueil-points { display: flex; flex-direction: column; gap: 10px; padding: 22px 6px 0; }
.accueil-point { display: flex; gap: 14px; align-items: center; background: var(--carte); border-radius: var(--rayon); padding: 13px 16px; }
.accueil-point b { display: block; font-size: 15px; }
.accueil-point span:not(.pastille-ico) { display: block; font-size: 13px; color: var(--doux); line-height: 1.35; margin-top: 2px; }
.pastille-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--ok-fond); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.accueil-actions { margin-top: auto; padding: 24px 6px 10px; display: flex; flex-direction: column; gap: 10px; }
.accueil-actions .aide { text-align: center; line-height: 1.45; }
.gros-btn { padding: 15px; font-size: 17px; font-weight: 700; border-radius: 12px; text-align: center; }
.centre { text-align: center; }
.formulaire-compte { max-width: 460px; margin-left: auto; margin-right: auto; }
.formulaire-compte label { margin-top: 12px; }
.champ-mdp { display: flex; align-items: center; gap: 6px; border: 1px solid var(--ligne); border-radius: 12px; background: var(--champ); padding-right: 6px; }
.champ-mdp input { border: 0; flex: 1; min-width: 0; background: transparent; }
.champ-mdp input:focus { outline: none; }
.champ-mdp:focus-within { outline: 2px solid var(--vert); outline-offset: 1px; }
.invitation-ok { display: flex; gap: 12px; align-items: center; background: var(--ok-fond); max-width: 460px; margin-left: auto; margin-right: auto; }
.invitation-ok b { display: block; color: var(--ok); }
.invitation-ok span:not(.rond-ok) { font-size: 14px; }
.invitation-ok span b { display: inline; }
.rond-ok, .rond-num { width: 32px; height: 32px; border-radius: 50%; background: var(--vert); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.rond-num { width: 30px; height: 30px; font-size: 15px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .05em; }
.intro-install { padding: 6px 4px 12px; }
.intro-install .surtitre { font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--vert); }
.intro-install h2 { margin: 6px 0; font-size: 24px; line-height: 1.2; }
.intro-install p { margin: 0; color: var(--doux); line-height: 1.45; }
.etape-install { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--ligne); }
.etape-install:last-child { border-bottom: 0; }
.etape-install .txt { flex: 1; }
.etape-install .txt b { display: block; font-size: 15px; }
.etape-install .txt span { display: block; font-size: 13px; color: var(--doux); line-height: 1.35; margin-top: 2px; }
.ico-install { width: 44px; height: 44px; border-radius: 11px; background: var(--fond); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* carte « Bienvenue » et tuiles de catégories */
.bienvenue .bv-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.bienvenue .bv-titre { font-size: 21px; font-weight: 800; }
.bienvenue .bv-compte { font-size: 13px; font-weight: 700; color: var(--vert); white-space: nowrap; }
.bv-barre { height: 8px; border-radius: 99px; background: var(--secondaire); margin: 12px 0 4px; overflow: hidden; }
.bv-barre div { height: 100%; border-radius: 99px; background: var(--vert); }
.bv-etape { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--ligne); }
.bv-etape .txt { flex: 1; }
.bv-etape .nom { font-size: 15px; font-weight: 700; }
.bv-etape.fait .nom { font-weight: 400; color: var(--doux); }
.bv-rond { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #b9b5ab; box-sizing: border-box; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; color: #fff; }
.bv-etape.fait .bv-rond { background: var(--vert); border-color: var(--vert); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tuiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tuile { background: var(--carte); border-radius: var(--rayon); min-height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: var(--texte); text-decoration: none; font-size: 13px; font-weight: 600; box-shadow: 0 1px 2px var(--ombre); padding: 6px; text-align: center; }
.tuile .ico-tuile { font-size: 26px; line-height: 1; }
.tuile .ico-tuile img { width: 30px; height: 30px; }
.centre a, .formulaire-compte a { color: var(--vert); text-decoration: none; }
.bv-etape .btn, .bv-etape button { padding: 8px 12px; font-size: 14px; white-space: nowrap; }

/* onglet « À surveiller » */
.att-compteurs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.att-compteurs div { background: var(--fond); border-radius: 10px; padding: 8px 4px; text-align: center; font-size: 13px; color: var(--doux); }
.att-compteurs b { display: block; font-size: 22px; color: var(--texte); }
.att-rappels { background: var(--rouge-fond); }
.att-rappels h2 { color: var(--rouge); }
.att-rappels .ia-item { border-bottom-color: rgba(192, 57, 43, .25); }
.att-lien-rappel { background: var(--rouge-fond); color: var(--rouge); font-weight: 600; }
.att-lb { font-size: 13px; font-weight: 600; color: var(--doux); margin-top: 10px; }
.att-actions { flex-wrap: wrap; }
.att-verifie { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--ligne); }
.att-verifie:last-child { border-bottom: 0; }
