@font-face { font-family: Montserrat; font-weight: 400; font-display: swap; src: url(/fonts/montserrat-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Montserrat; font-weight: 600; font-display: swap; src: url(/fonts/montserrat-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Montserrat; font-weight: 800; font-display: swap; src: url(/fonts/montserrat-latin-800-normal.woff2) format('woff2'); }

:root {
  --petrole: #16394A;
  --petrole-2: #1d4a5f;
  --nuit: #0f2833;
  --jaune: #FBBC05;
  --fond: #f4f6f7;
  --carte: #ffffff;
  --texte: #1c2b33;
  --doux: #5b6b74;
  --trait: #dfe5e8;
  --ok: #1f9d6b;
  --ok-fond: #e3f5ed;
  --attente: #b86e00;
  --attente-fond: #fdf1dc;
  --manque: #b3372f;
  --manque-fond: #fbe9e7;
  --clim: #2b7fb8;
  --pv: #d99a00;
  --irve: #1f9d6b;
  --rayon: 14px;
  --ombre: 0 1px 2px rgba(15, 40, 51, .06), 0 6px 20px rgba(15, 40, 51, .05);
  --menu-l: 248px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font-family: Montserrat, system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.5;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 800; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
a { color: var(--petrole-2); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(251, 188, 5, .75); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------- coque ---------- */
.coque { min-height: 100vh; }
.menu {
  position: fixed; inset: 0 auto 0 0; width: var(--menu-l); background: linear-gradient(180deg, var(--petrole), var(--nuit));
  color: #eaf1f4; padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; z-index: 30;
}
.marque { display: flex; align-items: center; gap: 11px; padding: 4px 10px 22px; text-decoration: none; color: #fff; }
.marque img { width: 36px; height: 36px; display: block; }
.marque strong { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.marque small { display: block; font-size: 11.5px; color: #9fb3bd; font-weight: 400; }
.menu a.lien {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: #cfdde3;
  text-decoration: none; font-weight: 600; font-size: 14px;
}
.menu a.lien:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.menu a.lien[aria-current='page'] { background: rgba(251, 188, 5, .14); color: #fff; box-shadow: inset 3px 0 0 var(--jaune); }
.menu .titre-groupe { margin: 18px 12px 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #7e96a1; font-weight: 600; }
.menu .pastille { margin-left: auto; min-width: 22px; padding: 0 7px; text-align: center; font-size: 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); }
.menu .pastille.alerte { background: var(--jaune); color: #1c2b33; font-weight: 800; }
.point { width: 10px; height: 10px; border-radius: 50%; flex: none; margin: 0 3px; }
.point.clim { background: var(--clim); } .point.pv { background: var(--pv); } .point.irve { background: var(--irve); }
.ico { width: 18px; height: 18px; flex: none; opacity: .85; }

.contenu { margin-left: var(--menu-l); padding: 34px clamp(20px, 4vw, 52px) 80px; max-width: 1240px; outline: none; }
.barre-mobile { display: none; }
.voile { position: fixed; inset: 0; background: rgba(15, 40, 51, .5); z-index: 20; }

/* ---------- éléments communs ---------- */
.entete { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.entete p { color: var(--doux); margin-top: 6px; max-width: 62ch; }
.fil { font-size: 13px; color: var(--doux); margin-bottom: 8px; }
.fil a { color: var(--doux); text-decoration: none; font-weight: 600; } .fil a:hover { color: var(--petrole); text-decoration: underline; }
.section { margin-top: 34px; }
.section > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section > header span { color: var(--doux); font-size: 13px; }
.grille { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 18px; }
.carte.cliquable { text-decoration: none; color: inherit; display: block; transition: transform .12s, box-shadow .12s, border-color .12s; }
.carte.cliquable:hover { transform: translateY(-2px); border-color: #b9c6cc; box-shadow: 0 2px 4px rgba(15, 40, 51, .08), 0 12px 28px rgba(15, 40, 51, .09); }
.vide { padding: 34px 20px; text-align: center; color: var(--doux); background: var(--carte); border: 1px dashed #c4d0d5; border-radius: var(--rayon); }
.vide strong { display: block; color: var(--texte); margin-bottom: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 10px;
  border: 1px solid var(--trait); background: #fff; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; color: var(--texte);
}
.btn:hover { border-color: #9fb0b8; background: #fafcfc; }
.btn.principal { background: var(--petrole); border-color: var(--petrole); color: #fff; }
.btn.principal:hover { background: var(--petrole-2); }
.btn.danger { color: var(--manque); }
.btn.danger:hover { background: var(--manque-fond); border-color: #e3aaa5; }
.btn.petit { min-height: 34px; padding: 4px 12px; font-size: 13px; }
.btn.lien { border-color: transparent; background: transparent; padding-left: 4px; padding-right: 4px; color: var(--petrole-2); }
.btn[disabled] { opacity: .5; cursor: default; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef2f4; color: #3d4f58; white-space: nowrap; }
.badge.ok { background: var(--ok-fond); color: #11694a; } .badge.attente { background: var(--attente-fond); color: var(--attente); }
.badge.manque { background: var(--manque-fond); color: var(--manque); }
.badge.clim { background: #e4f0f8; color: #1b5d8a; } .badge.pv { background: #fbf0cc; color: #8a6200; } .badge.irve { background: var(--ok-fond); color: #11694a; }

.champ { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.champ label { font-size: 13px; font-weight: 600; color: #3d4f58; }
.champ input, .champ select, .champ textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #c9d4d9; border-radius: 10px; background: #fff; min-height: 42px;
}
.champ textarea { min-height: 84px; resize: vertical; }
.champ small { color: var(--doux); font-size: 12px; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.barre { height: 8px; border-radius: 999px; background: #e6ecee; overflow: hidden; }
.barre > i { display: block; height: 100%; border-radius: 999px; background: var(--ok); transition: width .3s; }
.carte .barre { margin: 12px 0 8px; }
.barre.bas > i { background: var(--manque); } .barre.moyen > i { background: #e0a100; }

/* ---------- accueil ---------- */
.chiffres { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.chiffre h3 { display: flex; align-items: center; gap: 9px; }
.chiffre .gros { font-size: 34px; font-weight: 800; letter-spacing: -.02em; margin: 10px 0 2px; }
.chiffre .gros small { font-size: 14px; font-weight: 600; color: var(--doux); letter-spacing: 0; }
.chiffre p { color: var(--doux); font-size: 13px; }

/* ---------- catalogue ---------- */
.app { display: flex; flex-direction: column; gap: 10px; }
.app .tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.app .tete h3 { font-size: 16px; font-weight: 800; }
.app .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.app p { color: var(--doux); font-size: 13.5px; flex: 1; }
.app .dossier { font-size: 12px; color: var(--doux); word-break: break-all; }
.app .actions { margin-top: 4px; }
.sous-titre-statut { display: flex; align-items: center; gap: 10px; margin: 30px 0 14px; }
.sous-titre-statut h2 { font-size: 15px; }
.sous-titre-statut .compte { color: var(--doux); font-size: 13px; }

/* ---------- listes ---------- */
.liste { display: flex; flex-direction: column; gap: 10px; }
.ligne { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(120px, .8fr) minmax(150px, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px; text-decoration: none; color: inherit; }
.ligne .nom { font-weight: 600; word-break: break-word; }
.ligne .sous { font-size: 12.5px; color: var(--doux); font-weight: 400; }
.ligne .pct { font-size: 12.5px; color: var(--doux); margin-top: 4px; }
.outils { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.outils input[type=search] { flex: 1 1 240px; padding: 9px 14px; border: 1px solid #c9d4d9; border-radius: 10px; min-height: 42px; background: #fff; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills button { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--trait); background: #fff; font-weight: 600; font-size: 13px; cursor: pointer; }
.pills button[aria-pressed='true'] { background: var(--petrole); border-color: var(--petrole); color: #fff; }

/* ---------- chantier ---------- */
.resume-chantier { display: grid; grid-template-columns: 1fr minmax(240px, 340px); gap: 18px; align-items: start; }
.questions { display: flex; flex-direction: column; gap: 10px; }
.question { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--trait); }
.question:last-child { border-bottom: 0; }
.question strong { font-size: 14px; font-weight: 600; } .question small { display: block; color: var(--doux); font-size: 12.5px; }
.tri { display: inline-flex; border: 1px solid #c9d4d9; border-radius: 10px; overflow: hidden; }
.tri button { border: 0; background: #fff; padding: 6px 14px; font-weight: 600; font-size: 13px; cursor: pointer; min-height: 34px; }
.tri button + button { border-left: 1px solid #c9d4d9; }
.tri button[aria-pressed='true'] { background: var(--petrole); color: #fff; }
.checklist { margin-top: 10px; }
.groupe-titre { margin: 26px 0 10px; display: flex; align-items: center; gap: 10px; }
.doc { background: #fff; border: 1px solid var(--trait); border-radius: 12px; margin-bottom: 8px; }
.doc.fait { background: #fbfdfc; }
.doc.non { opacity: .55; }
.doc .rang { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; padding: 11px 14px; }
.coche {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid #b5c3ca; background: #fff; cursor: pointer; display: grid; place-items: center; padding: 0; color: #fff;
}
.coche:hover { border-color: var(--ok); }
.doc.fait .coche { background: var(--ok); border-color: var(--ok); }
.coche svg { width: 15px; height: 15px; opacity: 0; } .doc.fait .coche svg { opacity: 1; }
.doc.sans_objet .coche { background: #e9eef0; border-color: #c4d0d5; }
.doc .libelle { font-weight: 600; font-size: 14px; word-break: break-word; }
.doc.fait .libelle { color: var(--doux); }
.doc.sans_objet .libelle { text-decoration: line-through; color: var(--doux); }
.doc .aide { display: block; font-weight: 400; font-size: 12.5px; color: var(--doux); }
.doc select.statut { min-height: 34px; padding: 4px 8px; border-radius: 8px; border: 1px solid #c9d4d9; background: #fff; font-size: 13px; font-weight: 600; }
.doc select.statut.fait { background: var(--ok-fond); border-color: #a9dcc4; color: #11694a; }
.doc select.statut.en_attente { background: var(--attente-fond); border-color: #ecc98a; color: var(--attente); }
.detail-doc { padding: 4px 14px 14px 54px; display: grid; gap: 0 14px; grid-template-columns: 170px 1fr; }
.detail-doc .large { grid-column: 1 / -1; }
.note-pertinence { font-size: 12px; color: var(--attente); font-weight: 600; }

/* ---------- fenêtre ---------- */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 28px)); box-shadow: 0 30px 80px rgba(15, 40, 51, .35); color: var(--texte); }
dialog::backdrop { background: rgba(15, 40, 51, .55); }
dialog form { padding: 24px; }
dialog h2 { font-size: 20px; margin-bottom: 18px; }
dialog .pied { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

.notif { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--nuit); color: #fff; padding: 11px 20px; border-radius: 12px; z-index: 60; box-shadow: var(--ombre); font-weight: 600; font-size: 14px; max-width: calc(100vw - 32px); }
.notif.erreur { background: var(--manque); }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .barre-mobile { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 25; background: var(--petrole); color: #fff; padding: 10px 16px; }
  .marque-mini { font-weight: 800; }
  .bouton-menu { background: transparent; border: 0; width: 42px; height: 42px; display: grid; place-content: center; gap: 5px; cursor: pointer; }
  .bouton-menu span { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; }
  .menu { transform: translateX(-100%); transition: transform .2s; width: min(300px, 86vw); }
  .menu.ouvert { transform: none; }
  .contenu { margin-left: 0; padding: 22px 16px 70px; }
  h1 { font-size: 22px; }
  .resume-chantier { grid-template-columns: 1fr; }
  .ligne { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .ligne > :nth-child(2) { grid-column: 1; } .ligne > :nth-child(3) { grid-column: 1 / -1; } .ligne > :nth-child(4) { grid-column: 2; grid-row: 1; }
  .deux { grid-template-columns: 1fr; }
  .doc .rang { grid-template-columns: auto 1fr auto; }
  .doc .rang .btn { grid-column: 3; grid-row: 2; justify-self: end; }
  .doc select.statut { grid-column: 2 / 4; grid-row: 2; justify-self: start; }
  .detail-doc { grid-template-columns: 1fr; padding-left: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- entretiens clim ---------- */
.zones { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.zone-carte header { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.zone-carte h3 { font-size: 17px; }
.zone-carte .infos { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.zone-carte .proposer { background: #f1f7fa; border: 1px solid var(--trait); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin: 10px 0 12px; }
.zone-carte .proposer .actions { margin-top: 8px; }
.clients { display: flex; flex-direction: column; }
.client-ligne { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--trait); text-decoration: none; color: inherit; }
.client-ligne .sous { flex-basis: 100%; }
.client-ligne .nom { font-weight: 600; word-break: break-word; }
.client-ligne:hover .nom { text-decoration: underline; }
.client-ligne .sous { font-size: 12.5px; color: var(--doux); }
.ligne-simple { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; }
.ligne-simple .nom { font-weight: 600; }
.ligne-simple .sous { font-size: 12.5px; color: var(--doux); }
.nom-lien { font-weight: 700; color: var(--texte); text-decoration: none; }
.nom-lien:hover { text-decoration: underline; }
.actions.bas { margin-top: 12px; align-items: center; }
.liste.interne { margin-top: 10px; gap: 0; }
.plus { margin-top: 10px; }
.entretien-grille { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.entretien-grille h3 { margin-bottom: 8px; }
.echeance-grande { font-size: 30px; font-weight: 800; color: var(--petrole); margin: 2px 0 10px; }
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-top: 1px solid var(--trait); font-size: 14px; }
.kv strong { text-align: right; font-weight: 600; word-break: break-word; }
.montant { margin: 10px 0; padding: 10px 12px; background: #f1f7fa; border-radius: 10px; }
.montant strong { font-size: 19px; }
.visite-ligne { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--trait); border-radius: 12px; padding: 10px 14px; }
.visite-ligne select.statut { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--trait); background: #fff; font-weight: 600; font-size: 13px; }
.visite-ligne select.statut.fait { background: var(--ok-fond); border-color: #a9dcc4; color: #11694a; }
.visite-ligne select.statut.en_attente { background: var(--attente-fond); border-color: #ecc98a; color: var(--attente); }
.brouillon .champ { margin-bottom: 14px; }
.brouillon textarea, .brouillon input[readonly] { width: 100%; background: #f7fafb; font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid #c9d4d9; border-radius: 10px; resize: vertical; margin-bottom: 8px; }
.brouillon .actions select { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--trait); background: #fff; }
.historique { margin: 12px 0 0 18px; font-size: 13px; color: var(--doux); }
.sous.pre { white-space: pre-wrap; }
.repli-form { margin: 4px 0 14px; }
.repli-form summary { cursor: pointer; font-weight: 600; font-size: 14px; margin-bottom: 10px; }
dialog form { max-height: 88vh; overflow-y: auto; }
@media (max-width: 860px) {
  .zones { grid-template-columns: 1fr; }
  .visite-ligne { grid-template-columns: 1fr auto; }
  .visite-ligne .btn { justify-self: start; }
}
@media (max-width: 560px) {
  .chiffres { grid-template-columns: 1fr 1fr; gap: 10px; }
  .chiffres .carte { padding: 14px; }
  .kv { flex-direction: column; gap: 2px; } .kv strong { text-align: left; }
}
