/* Les pages du prototype (accueil, vue d'ensemble) : mêmes couleurs que l'application du technicien et la carte. */
:root {
  --paper: #f4f8f8; --surface: #ffffff; --ink: #14303a; --muted: #57707a; --line: #d6e2e5; --soft: #ebf2f3;
  --brand: #05676a; --brand-soft: #def1ed; --ok: #2a7d5e; --ok-soft: #e1f2ea; --wait: #94570c; --wait-soft: #fbeedb;
  --danger: #9b3443; --danger-soft: #fbe9ec;
  --f-titre: "Space Grotesk", "Inter", system-ui, sans-serif;
  --f-texte: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --largeur-page: 1240px;   /* la même largeur pour l'en-tête, le menu et le contenu de toutes les pages */
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--f-texte); }
h1, h2, h3 { font-family: var(--f-titre); margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.barre { background: var(--surface); border-bottom: 1px solid var(--line); }
.barre-dedans { max-width: var(--largeur-page); margin: 0 auto; padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
  display: flex; gap: 12px 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.marque { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.marque .logo { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: #123f48; color: #fff; font-weight: 700; }
.marque strong { letter-spacing: .14em; font-size: .9rem; display: block; }
.marque small { color: var(--muted); font-size: .78rem; }
.qui { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .88rem; color: var(--muted); }
.page { max-width: var(--largeur-page); margin: 0 auto; padding-block: 24px 64px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
.champ { display: grid; gap: 4px; font-size: .86rem; }
.champ > span { color: var(--muted); font-weight: 500; }
input, select, textarea { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 8px 10px; min-width: 0; }
.bouton { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 14px; font-weight: 600; cursor: pointer; }
.bouton:hover:not(:disabled) { border-color: var(--brand); }
.bouton:disabled { opacity: .45; cursor: default; }
.bouton.principal { background: var(--brand); border-color: var(--brand); color: #fff; }
.bouton.danger { color: var(--danger); }
.carte { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.muted { color: var(--muted); }
.petit { font-size: .82rem; }
.erreur { background: var(--danger-soft); color: var(--danger); border-radius: 8px; padding: 8px 12px; font-size: .88rem; }
.pastille { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.pastille.fait { background: var(--ok-soft); color: var(--ok); }
.pastille.en_cours { background: var(--wait-soft); color: var(--wait); }
.pastille.a_faire { background: var(--soft); color: var(--muted); }

/* La frise des étapes du chantier */
.frise { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(118px, 1fr); gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.frise .etape { border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; background: var(--surface); display: grid; gap: 2px; align-content: start; font-size: .76rem; }
.frise .etape .n { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.frise .etape .t { font-weight: 600; line-height: 1.25; }
.frise .etape .r { color: var(--muted); }
.frise .etape.fait { background: var(--ok-soft); border-color: transparent; }
.frise .etape.fait .n::after { content: " ✓"; color: var(--ok); }
.frise .etape.en_cours { background: var(--wait-soft); border-color: transparent; }
.frise .etape.courante { border: 2px solid var(--brand); }
.frise .phase { grid-row: 1; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--line); padding-bottom: 2px; }
.frise .etape { grid-row: 2; }

/* ——— Le cadre commun des pages ———
   Toutes les pages (accueil, chantier, base de données, paramètres, suivi, comptes) : la barre IPELEC, le menu, puis
   le contenu, à la même largeur. Une page en plusieurs parties a le menu de ses parties à gauche (.cadre-sections). */
.entete-page { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px 20px; flex-wrap: wrap; }
.entete-page h1 { font-size: 1.6rem; }
.entete-page p { margin: 4px 0 0; color: var(--muted); }
.cadre-sections { max-width: var(--largeur-page); margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 64px max(16px, env(safe-area-inset-left, 0px));
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.menu-sections { position: sticky; top: 16px; display: grid; gap: 2px; }
.menu-sections .section { display: block; width: 100%; text-align: left; border: 0; background: none; border-radius: 8px; padding: 9px 12px;
  font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; text-decoration: none; }
.menu-sections .section:hover { background: var(--soft); }
.menu-sections .section[aria-current="page"], .menu-sections .section[aria-selected="true"] { background: var(--brand); color: #fff; }
.contenu-sections { min-width: 0; display: grid; gap: 18px; align-content: start; }
@media (max-width: 820px) {
  .cadre-sections { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .menu-sections { position: static; display: flex; flex-wrap: wrap; }
  .menu-sections .section { width: auto; }
}

/* Connecté, la barre du compte (tout en haut) dit déjà qui travaille : pas de doublon à droite de l'en-tête. */
html:has(#ipelec-session) .barre .qui { display: none; }
