/* Suivi des demandes — charte Épingle.
   Fond plan, encre, un seul aplat rouge (le bouton principal), surligneur jaune
   pour ce qui est nouveau. */

@font-face { font-family: "Bricolage Grotesque"; src: url(/polices/bricolage-titres.woff2) format("woff2"); font-weight: 700 800; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url(/polices/schibsted-texte.woff2) format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(/polices/plex-mono-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --plan: #F3F4F1;
  --encre: #15171C;
  --rouge: #E5382A;
  --jaune: #FFC933;
  --papier: #FFFFFF;
  --trait: rgba(21, 23, 28, .14);
  --doux: rgba(21, 23, 28, .62);
  --vert: #1E6B45;
  --texte: "Schibsted Grotesk", Arial, sans-serif;
  --titres: "Bricolage Grotesque", "Arial Narrow", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--plan); color: var(--encre); font: 16px/1.55 var(--texte); }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--rouge); }
:focus-visible { outline: 3px solid var(--encre); outline-offset: 2px; }
img { max-width: 100%; }

h1, h2 { font-family: var(--titres); font-weight: 800; font-stretch: 90%; line-height: 1.1; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); }
h2 { font-size: 1.3rem; margin-bottom: .8rem; }
p { margin: 0 0 .8rem; }
code, pre { font-family: var(--mono); font-size: .85rem; }

/* En-tête */
.entete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1.5rem; padding: .9rem 16px; border-bottom: 1px solid var(--trait); background: var(--papier); }
.marque { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.marque img { display: block; height: 30px; width: auto; }
.marque span { font: 500 .78rem var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: .15rem .5rem; border: 1px solid var(--trait); border-radius: 4px; }
.entete nav { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1.2rem; font-weight: 600; font-size: .95rem; }
.entete nav a { text-decoration: none; padding: .2rem 0; border-bottom: 2px solid transparent; }
.entete nav a[aria-current="page"] { border-bottom-color: var(--encre); }
.entete nav form { margin: 0; }
.entete nav button.lien { text-decoration: none; padding: .2rem 0; }

main { max-width: 1080px; margin: 0 auto; padding: 1.6rem 16px 4rem; }
section { margin-top: 2.4rem; }
.etroit { max-width: 460px; margin: 2rem auto 0; }
.etroit h1 { margin-bottom: 1rem; }

.titre-page { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .8rem 1.5rem; margin-bottom: 1.4rem; }
.fil { font: 500 .8rem var(--mono); color: var(--doux); margin-bottom: .5rem; }

/* Choix du mois */
.mois { display: inline-flex; align-items: center; gap: .3rem; background: var(--papier); border: 1px solid var(--trait); border-radius: 8px; padding: .25rem; }
.mois strong { min-width: 9.5rem; text-align: center; font-weight: 700; }
.mois a, .mois .inactif { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 6px; text-decoration: none; font-size: 1.1rem; }
.mois a:hover { background: var(--plan); color: var(--encre); }
.mois .inactif { opacity: .25; }

/* Tuiles de chiffres */
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; }
.tuile { display: flex; flex-direction: column; gap: .15rem; background: var(--papier); border: 1px solid var(--trait); border-radius: 12px; padding: 1rem 1.1rem; }
.tuile .valeur { font: 800 2.7rem/1 var(--titres); font-stretch: 90%; font-variant-numeric: tabular-nums; margin: .35rem 0 .2rem; }
.tuile .avant, .etiquette, .aide, .ecart { font: 500 .78rem/1.45 var(--mono); color: var(--doux); }
.etiquette { text-transform: uppercase; letter-spacing: .05em; }
.tuile .aide { margin-top: .4rem; }
.aide { display: block; text-transform: none; letter-spacing: 0; }
p.aide { margin-top: .6rem; }
.ecart { margin-left: .25rem; white-space: nowrap; }

/* Tableaux */
.defilant { overflow-x: auto; border: 1px solid var(--trait); border-radius: 12px; background: var(--papier); }
.tableau { width: 100%; border-collapse: collapse; background: var(--papier); }
section > .tableau, .feuille .tableau { border: 1px solid var(--trait); border-radius: 12px; overflow: hidden; }
.tableau th, .tableau td { padding: .7rem .9rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--trait); }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau th { font: 500 .74rem var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--doux); white-space: nowrap; }
.tableau .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tableau .fort { font-weight: 800; font-size: 1.15rem; }
.tableau td a { text-decoration: none; }
.tableau td a:hover { text-decoration: underline; }

/* Pastilles */
.pastilles { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.pastille { display: inline-block; font: 500 .72rem/1 var(--mono); text-transform: uppercase; letter-spacing: .04em; padding: .32rem .5rem; border-radius: 4px; border: 1px solid var(--trait); background: var(--papier); white-space: nowrap; }
.pastille.nouvelle { background: var(--jaune); border-color: var(--jaune); }
.pastille.ok { color: var(--vert); border-color: currentColor; }
.pastille.attente { border-style: dashed; color: var(--doux); }
.pastille.essai { background: var(--encre); color: #fff; border-color: var(--encre); }

/* Demandes */
.demandes { display: grid; gap: 10px; }
.demande { background: var(--papier); border: 1px solid var(--trait); border-radius: 12px; padding: .9rem 1.1rem; }
.demande.attenuee { opacity: .55; }
.demande-tete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem; margin-bottom: .5rem; }
.demande p { margin: 0 0 .3rem; overflow-wrap: anywhere; }
.demande .qui { font-size: 1.05rem; }
.demande .contact a { font-weight: 600; }
.demande .message, .message.entier { color: rgba(21, 23, 28, .85); }
.message.entier { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--papier); border: 1px solid var(--trait); border-radius: 12px; padding: 1rem 1.1rem; }
.demande .pied { display: flex; justify-content: space-between; gap: 1rem; margin-top: .6rem; }
.demande .pied a { font-weight: 700; }

/* Fiches */
.fiche { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: .5rem 1.2rem; margin: 1rem 0 0; background: var(--papier); border: 1px solid var(--trait); border-radius: 12px; padding: 1rem 1.1rem; }
.fiche dt { font: 500 .74rem/1.9 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--doux); }
.fiche dd { margin: 0; overflow-wrap: anywhere; }

/* Formulaires */
.formulaire { display: grid; gap: .9rem; max-width: 460px; }
.formulaire.en-ligne { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem; max-width: none; }
.formulaire.discret { margin-top: .6rem; }
label { display: grid; gap: .25rem; font-weight: 600; font-size: .92rem; }
input, select, textarea { font: inherit; color: inherit; background: var(--papier); border: 1px solid rgba(21, 23, 28, .35); border-radius: 8px; padding: .55rem .7rem; min-height: 44px; width: 100%; }
.en-ligne label { flex: 1 1 200px; }
textarea { resize: vertical; }
.bouton { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .5rem 1.1rem; font: 700 .95rem var(--texte); color: #fff; background: var(--rouge); border: 1px solid var(--rouge); border-radius: 8px; cursor: pointer; text-decoration: none; }
.bouton:hover { background: var(--encre); border-color: var(--encre); color: #fff; }
.bouton.secondaire { background: var(--papier); color: var(--encre); border-color: rgba(21, 23, 28, .35); }
.bouton.secondaire:hover { background: var(--encre); color: #fff; }
.bouton.danger { background: var(--papier); color: var(--rouge); border-color: var(--rouge); }
.bouton.danger:hover { background: var(--rouge); color: #fff; }
button.lien { all: unset; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font: inherit; }
button.lien:hover { color: var(--rouge); }
button.lien:focus-visible { outline: 3px solid var(--encre); outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }

/* Messages */
.note, .erreur { background: var(--papier); border: 1px solid var(--trait); border-left: 5px solid var(--jaune); border-radius: 8px; padding: .8rem 1rem; margin-bottom: 1.2rem; }
.erreur { border-left-color: var(--rouge); font-weight: 600; }
.note pre, .code pre { background: var(--plan); border-radius: 6px; padding: .7rem .8rem; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: .5rem 0 .7rem; }
.vide { color: var(--doux); background: var(--papier); border: 1px dashed var(--trait); border-radius: 12px; padding: 1rem 1.1rem; }

/* Sites et branchement */
.sites { list-style: none; margin: 0 0 1.2rem; padding: 0; display: grid; gap: 10px; }
.sites > li { background: var(--papier); border: 1px solid var(--trait); border-radius: 12px; padding: .9rem 1.1rem; }
.sites p { margin-bottom: .4rem; }
details summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: .6rem; }
.code a { margin-left: .8rem; font-weight: 600; }
.etapes { padding-left: 1.2rem; margin: 0 0 1.4rem; }
.etapes li { margin-bottom: .3rem; }
.notes { padding-left: 1.2rem; margin: 0 0 1rem; }
.notes li { margin-bottom: .35rem; }

/* Onglets de l'espace d'un client */
.onglets { display: flex; flex-wrap: wrap; gap: .2rem .3rem; margin: -.4rem 0 1.6rem; padding-bottom: .5rem; border-bottom: 1px solid var(--trait); }
.onglets a { text-decoration: none; font-weight: 600; font-size: .95rem; padding: .45rem .8rem; border-radius: 8px; min-height: 40px; display: inline-flex; align-items: center; }
.onglets a:hover { background: var(--papier); color: var(--encre); }
.onglets a[aria-current="page"] { background: var(--encre); color: #fff; }
h2.grand { font-size: clamp(1.4rem, 3.5vw, 1.9rem); margin-bottom: 1rem; }
h3 { font: 800 1.05rem var(--titres); font-stretch: 90%; margin: 1.6rem 0 .6rem; }

/* Listes simples */
.liste { list-style: none; margin: 0; padding: 0; background: var(--papier); border: 1px solid var(--trait); border-radius: 12px; }
.liste li { padding: .7rem 1.1rem; border-bottom: 1px solid var(--trait); overflow-wrap: anywhere; }
.liste li:last-child { border-bottom: 0; }
.sites > li.attenuee { opacity: .55; }
.pre { white-space: pre-line; overflow-wrap: anywhere; }

/* Cases à cocher et horaires */
label.case { display: flex; align-items: flex-start; gap: .6rem; font-weight: 600; }
label.case input { width: 1.3rem; min-height: 1.3rem; height: 1.3rem; margin-top: .15rem; flex: none; }
.horaires { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .6rem; }
.horaires label::first-letter { text-transform: uppercase; }
.formulaire.large { max-width: none; }
.piege { position: absolute; left: -6000px; width: 1px; height: 1px; overflow: hidden; }

/* Saisie des lignes d'un devis */
.tableau.saisie td { padding: .35rem; vertical-align: top; }
.tableau.saisie td:first-child { min-width: 240px; width: 46%; }
.tableau.saisie input, .tableau.saisie select, .tableau.saisie textarea { min-width: 76px; }

/* Devis */
.devis-tete { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 1.4rem; }
.devis-tete p { margin-bottom: .2rem; }
.devis-entreprise { font: 800 1.35rem var(--titres); font-stretch: 90%; }
.devis-ref { text-align: right; }
.devis-numero { font: 800 1.5rem var(--titres); font-stretch: 90%; }
.devis-numero::after { content: ""; display: block; width: 3rem; height: 5px; background: var(--rouge); margin: .4rem 0 .4rem auto; }
.devis-pour { background: var(--plan); border-radius: 8px; padding: .8rem 1rem; margin-bottom: 1.2rem; max-width: 26rem; }
.devis-pour p { margin: 0; }
.tableau.totaux { width: auto; min-width: min(100%, 22rem); margin: 1rem 0 1.2rem auto; }
.mentions { font-size: .9rem; color: var(--doux); border-top: 1px solid var(--trait); padding-top: .8rem; margin-top: 1rem; }
.apercu .feuille { max-width: 860px; }

/* Pages vues par les particuliers */
.public .entete { justify-content: space-between; }
.enseigne { font: 800 1.2rem var(--titres); font-stretch: 90%; }
.etroit.large { max-width: 640px; }
.choix { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 10px; }
.choix a { display: grid; gap: .2rem; text-decoration: none; background: var(--papier); border: 1px solid var(--trait); border-radius: 12px; padding: 1rem 1.1rem; }
.choix a:hover { border-color: var(--encre); color: var(--encre); }
.jour { margin-top: 1.4rem; }
.jour h2 { font-size: 1.05rem; margin-bottom: .5rem; }
.jour h2::first-letter { text-transform: uppercase; }
.creneaux { display: flex; flex-wrap: wrap; gap: .5rem; }
.creneaux .bouton { min-width: 5.2rem; }

/* Rapport imprimable */
.feuille { background: var(--papier); border: 1px solid var(--trait); border-radius: 12px; padding: clamp(1.2rem, 4vw, 2.6rem); max-width: 800px; }
.feuille h1 { margin: .3rem 0 .2rem; }
.feuille h2 { margin: 1.8rem 0 .7rem; }
.feuille .periode { font: 800 1.3rem var(--titres); font-stretch: 90%; margin-bottom: 1.4rem; }
.feuille .periode::after { content: ""; display: block; width: 3rem; height: 5px; background: var(--rouge); margin-top: .6rem; }

@media (max-width: 640px) {
  .fiche { grid-template-columns: 1fr; gap: .1rem; }
  .fiche dd { margin-bottom: .6rem; }
  .mois strong { min-width: 7.5rem; }
}

@media print {
  body { background: #fff; }
  .entete, .sans-impression, .onglets { display: none; }
  section.apercu { margin-top: 0; }
  main { padding: 0; max-width: none; }
  .feuille { border: 0; padding: 0; max-width: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .bouton, .mois a { transition: background-color .12s ease, color .12s ease; }
}
