/* ════════════════════════════════════════════════════════════════════
   CARNET DE SERVICE — style.css
   Couleurs claires et douces · en-têtes vert foncé · cases à saisir
   jaune pâle · familles de colonnes encadrées · mobile d'abord.
   ════════════════════════════════════════════════════════════════════ */
:root {
  color-scheme: light;
  /* Couleurs de base */
  --fond: #F4F7F5;
  --carte: #FFFFFF;
  --texte: #1E2B26;
  --doux: #5E6E67;
  --trait: #D3DDD8;          /* traits fins entre colonnes */
  --cadre: #2D6553;          /* cadre épais des familles */
  --vert: #2D6553;           /* en-têtes */
  --vert-clair: #E3EFEA;
  --saisie: #FFF6C4;         /* cases à saisir */
  --saisie-bord: #E6D88A;
  /* États du jour */
  --e-repos: #D5EFD9;   --e-repos-t: #1F6B33;
  --e-ferie: #FBEFA9;   --e-ferie-t: #7A5A00;
  --e-conge: #D6E6FA;   --e-conge-t: #1F4F8F;
  --e-maladie: #F8D7E4; --e-maladie-t: #8E2457;
  --e-saisir: #FFDDB8;  --e-saisir-t: #9A4A00;
  /* Alertes */
  --rouge: #C62828; --rouge-fond: #FDE3E3;
  --orange: #C26100; --orange-fond: #FFEBD6;
  --ok: #2E7D4F;
  /* Typo */
  --police: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --chiffres: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --barre: 64px;            /* hauteur de la barre d'onglets */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font-family: var(--police); font-size: 16px; line-height: 1.4;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: calc(var(--barre) + env(safe-area-inset-bottom, 0px));
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #E0A400; outline-offset: 2px; }
.chiffre { font-family: var(--chiffres); font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ───────────── En-tête ───────────── */
.entete {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--vert); color: #fff;
  display: flex; align-items: center; gap: 10px;
  padding: 10px max(14px, env(safe-area-inset-right, 0px)) 10px max(14px, env(safe-area-inset-left, 0px));
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--vert); z-index: 21; }
.entete h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: .01em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pastille {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px;
  padding: 4px 10px; border-radius: 16px; background: rgb(255 255 255 / .14);
  border: 0; color: #fff; font-size: 13px; white-space: nowrap;
}
.pastille::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #9FD8B4; }
.pastille[data-code="attente"]::before { background: #FFC266; }
.pastille[data-code="off"]::before { background: #FF8A80; }
.pastille[data-code="demo"]::before { background: #CFE0FF; }
.bouton-legende { min-width: 44px; min-height: 44px; border-radius: 22px; border: 1px solid rgb(255 255 255 / .35); background: transparent; color: #fff; font-weight: 700; }

/* ───────────── Zone d'écran ───────────── */
main { padding: 14px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); max-width: 1100px; margin: 0 auto; display: grid; gap: 14px; }
h2 { margin: 0; font-size: 18px; }
h3 { margin: 0; font-size: 15px; color: var(--doux); text-transform: uppercase; letter-spacing: .05em; }
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: 12px; padding: 14px; display: grid; gap: 12px; min-width: 0; }
.doux { color: var(--doux); }
.petit { font-size: 13px; }
.ligne-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.espace { flex: 1; }

/* ───────────── Boutons ───────────── */
.btn {
  min-height: 44px; padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--trait); background: var(--carte); font-weight: 600;
}
.btn.principal { background: var(--vert); border-color: var(--vert); color: #fff; }
.btn.danger { color: var(--rouge); border-color: #F0C3C3; }
.btn.lien { border: 0; background: none; color: var(--vert); padding-inline: 4px; text-decoration: underline; }
.btn.large { width: 100%; }
.btn-icone { min-width: 44px; min-height: 44px; border-radius: 10px; border: 1px solid var(--trait); background: var(--carte); font-size: 20px; font-weight: 700; }

/* ───────────── Champs ───────────── */
label.champ { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--doux); min-width: 0; }
.saisie, select.saisie, textarea.saisie {
  min-height: 44px; width: 100%; min-width: 0;
  padding: 9px 11px; border-radius: 8px;
  background: var(--saisie); border: 1px solid var(--saisie-bord);
  font-size: 17px; color: var(--texte);
}
.saisie.gros { min-height: 56px; font-size: 24px; font-weight: 700; text-align: center; letter-spacing: .03em; }
.saisie.invalide { border-color: var(--rouge); background: var(--rouge-fond); }
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grille-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 360px) { .grille-3 { grid-template-columns: 1fr 1fr; } }
.case-cocher { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; }
.case-cocher input { width: 24px; height: 24px; accent-color: var(--vert); }

/* ───────────── Pastilles d'état, de ligne, de prime ───────────── */
.etat {
  display: inline-block; min-width: 54px; padding: 3px 8px; border-radius: 6px;
  font-size: 12px; font-weight: 700; text-align: center; letter-spacing: .03em;
  background: var(--carte); border: 1px solid var(--trait); white-space: nowrap;
}
.e-repos { background: var(--e-repos); color: var(--e-repos-t); border-color: #A9D9B2; }
.e-ferie { background: var(--e-ferie); color: var(--e-ferie-t); border-color: #E7D36A; }
.e-conge { background: var(--e-conge); color: var(--e-conge-t); border-color: #A9C6EE; }
.e-maladie { background: var(--e-maladie); color: var(--e-maladie-t); border-color: #EDB0C8; }
.e-saisir { background: var(--e-saisir); color: var(--e-saisir-t); border-color: #F2B87A; }
.e-travail { background: #fff; color: var(--texte); }
.ligne-bus { display: inline-block; padding: 2px 7px; border-radius: 5px; font-weight: 700; font-size: 13px; color: #fff; background: var(--doux); white-space: nowrap; }
.prime { display: inline-block; padding: 2px 7px; border-radius: 5px; font-size: 12px; font-weight: 700; background: var(--vert-clair); color: var(--vert); border: 1px solid #BFD8CD; }
.statut-inconnu { color: #fff; background: var(--rouge); padding: 2px 6px; border-radius: 5px; font-weight: 700; font-size: 12px; }
.statut-heures { color: #fff; background: var(--orange); padding: 2px 6px; border-radius: 5px; font-weight: 700; font-size: 12px; }

/* ───────────── Alertes ───────────── */
.alertes { display: grid; gap: 6px; }
.alerte { display: flex; gap: 8px; align-items: flex-start; padding: 9px 11px; border-radius: 8px; font-size: 14px; border: 1px solid; }
.alerte.rouge { background: var(--rouge-fond); border-color: #F2B5B5; color: #7F1616; }
.alerte.orange { background: var(--orange-fond); border-color: #F5C690; color: #7A3E00; }
.alerte.ok { background: #E3F3E8; border-color: #B5DCC2; color: #1E5A35; }
.alerte b { flex: none; }

/* ───────────── Écran Aujourd'hui ───────────── */
.jour-titre { display: flex; align-items: center; gap: 8px; }
.jour-titre h2 { flex: 1; text-align: center; font-size: 19px; text-wrap: balance; }
.chiffres-cles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 2px solid var(--cadre); border-radius: 10px; overflow: hidden; }
.chiffres-cles div { padding: 8px 6px; text-align: center; border-left: 1px solid var(--trait); display: grid; gap: 2px; }
.chiffres-cles div:first-child { border-left: 0; }
.chiffres-cles span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--doux); }
.chiffres-cles b { font-size: 18px; }
@media (max-width: 380px) { .chiffres-cles { grid-template-columns: repeat(2, 1fr); } .chiffres-cles div:nth-child(3) { border-left: 0; } .chiffres-cles div:nth-child(n+3) { border-top: 1px solid var(--trait); } }
.vacations { display: grid; gap: 6px; }
.vacation { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--vert-clair); }
.vacation .chiffre { font-size: 17px; font-weight: 700; }
.infos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.info { padding: 10px; border-radius: 8px; background: var(--fond); border: 1px solid var(--trait); display: grid; gap: 2px; }
.info span { font-size: 12px; color: var(--doux); }
.info b { font-size: 16px; }

/* ───────────── Journal (grand tableau) ───────────── */
.bandeau-verif { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--orange-fond); border: 1px solid #F5C690; color: #7A3E00; font-weight: 600; width: 100%; text-align: left; min-height: 44px; }
.bandeau-verif.ok { background: #E3F3E8; border-color: #B5DCC2; color: #1E5A35; }
.filtres { display: flex; gap: 6px; flex-wrap: wrap; }
.filtre { min-height: 40px; padding: 6px 14px; border-radius: 20px; border: 1px solid var(--trait); background: var(--carte); font-weight: 600; font-size: 14px; }
.filtre[aria-pressed="true"] { background: var(--vert); border-color: var(--vert); color: #fff; }

.table-zone { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--trait); border-radius: 10px; background: var(--carte); max-height: calc(100vh - 260px); }
table.journal { border-collapse: separate; border-spacing: 0; font-size: 14px; white-space: nowrap; }
table.journal th, table.journal td { padding: 0 8px; height: 44px; border-right: 1px solid var(--trait); border-bottom: 1px solid var(--trait); text-align: center; }
table.journal thead th { position: sticky; z-index: 3; background: var(--vert); color: #fff; font-weight: 700; font-size: 12px; border-right-color: rgb(255 255 255 / .25); border-bottom-color: rgb(255 255 255 / .25); }
table.journal thead tr:first-child th { top: 0; height: 30px; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
table.journal thead tr:nth-child(2) th { top: 30px; height: 34px; }
table.journal thead th.famille { text-align: left; padding-left: 12px; }
table.journal thead th[rowspan] { top: 0; }
/* Date figée à gauche */
table.journal .col-date { position: sticky; left: 0; z-index: 2; background: var(--carte); text-align: left; min-width: 76px; font-weight: 700; }
table.journal thead .col-date { z-index: 4; background: var(--vert); }
/* Familles de colonnes : cadre épais à gauche de chaque famille */
table.journal .debut-famille { border-left: 3px solid var(--cadre); }
table.journal thead .debut-famille { border-left-color: #173A2F; }
table.journal .col-date { border-right: 3px solid var(--cadre); }
/* Cases saisies : jaune pâle */
table.journal td.s { background: var(--saisie); }
table.journal tbody tr { cursor: pointer; }
table.journal tbody tr:hover td { filter: brightness(.97); }
table.journal tbody tr.aujourdhui td.col-date { box-shadow: inset 4px 0 0 #E0A400; }
table.journal tbody tr.semaine td { border-top: 2px solid #9DB3A9; }
table.journal td.alerte-rouge { background: var(--rouge-fond); color: #7F1616; font-weight: 700; }
table.journal td.alerte-orange { background: var(--orange-fond); color: #7A3E00; }
table.journal td.ctl { text-align: left; white-space: normal; min-width: 240px; max-width: 340px; padding-block: 6px; line-height: 1.3; font-size: 13px; }
table.journal td.obs { max-width: 180px; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.jour-court { display: block; font-size: 11px; font-weight: 600; color: var(--doux); text-transform: uppercase; }

/* ───────────── Menu « Plus » et listes ───────────── */
.menu { display: grid; gap: 0; background: var(--carte); border: 1px solid var(--trait); border-radius: 12px; overflow: hidden; }
.menu button { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; border: 0; border-top: 1px solid var(--trait); background: none; text-align: left; font-weight: 600; }
.menu button:first-child { border-top: 0; }
.menu button small { display: block; font-weight: 400; color: var(--doux); font-size: 13px; }
.menu button::after { content: "›"; margin-left: auto; font-size: 22px; color: var(--doux); }
.liste { display: grid; border: 1px solid var(--trait); border-radius: 10px; overflow: hidden; background: var(--carte); }
.liste > div { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--trait); min-height: 52px; flex-wrap: wrap; }
.liste > div:first-child { border-top: 0; }

/* ───────────── Roulement (28 cases) ───────────── */
.cycle { display: grid; grid-template-columns: 30px repeat(7, minmax(0, 1fr)); gap: 4px; align-items: center; }
.cycle span { text-align: center; font-size: 12px; color: var(--doux); font-weight: 600; }
.cycle button { min-height: 44px; border-radius: 8px; border: 1px solid var(--saisie-bord); background: var(--saisie); font-weight: 700; font-size: 13px; color: var(--doux); padding: 0; }
.cycle button[aria-pressed="true"] { background: var(--e-repos); border-color: #6FBF82; color: var(--e-repos-t); }

/* ───────────── Barre d'onglets ───────────── */
.onglets {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--carte); border-top: 1px solid var(--trait);
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.onglets button { min-height: var(--barre); border: 0; background: none; display: grid; place-items: center; align-content: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--doux); border-top: 3px solid transparent; }
.onglets svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.onglets button[aria-selected="true"] { color: var(--vert); border-top-color: var(--vert); }

/* ───────────── Feuille (fenêtre du bas) ───────────── */
.voile { position: fixed; inset: 0; z-index: 50; background: rgb(20 35 29 / .45); display: flex; align-items: flex-end; justify-content: center; }
.feuille {
  width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; background: var(--carte);
  border-radius: 16px 16px 0 0; display: grid; gap: 14px;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.feuille .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; position: sticky; bottom: -16px; background: var(--carte); padding-block: 10px; }
.feuille .actions .gauche { margin-right: auto; }
@media (prefers-reduced-motion: no-preference) { .feuille { animation: monte .2s ease-out; } @keyframes monte { from { transform: translateY(40px); opacity: .5; } } }
.legende { display: grid; gap: 6px; }
.legende div { display: flex; gap: 10px; align-items: center; font-size: 14px; }

/* ───────────── Message bref ───────────── */
.message { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--barre) + 14px + env(safe-area-inset-bottom, 0px)); z-index: 60; background: var(--texte); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; max-width: 90vw; }

/* ───────────── Écran de connexion ───────────── */
.connexion { max-width: 420px; margin: 8vh auto 0; }
.connexion img { width: 72px; height: 72px; border-radius: 16px; }

/* iPhone : le champ date ne déborde plus de sa case */
input[type="date"].saisie { -webkit-appearance: none; appearance: none; display: block; text-align: left; }
input[type="date"].saisie::-webkit-date-and-time-value { text-align: left; }

/* ───────────── Totaux ───────────── */
.filtres.defilant { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; margin-inline: -2px; scrollbar-width: none; }
.filtres.defilant::-webkit-scrollbar { display: none; }
.filtres.defilant .filtre { flex: none; }
table.journal.compact th { position: sticky; top: 0; height: 40px; }
table.journal.compact td { height: 44px; }
.barres { display: grid; gap: 8px; }
.barres div { display: grid; grid-template-columns: minmax(70px, auto) 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.barres i { display: block; height: 14px; border-radius: 7px; background: var(--vert); opacity: .8; }
.barres b { font-size: 13px; color: var(--doux); white-space: nowrap; }

/* ───────────── Paie ───────────── */
table.journal.fiche td { text-align: right; white-space: normal; height: auto; padding-block: 8px; }
table.journal.fiche td.col-date { text-align: left; font-weight: 600; min-width: 190px; }
table.journal.fiche tr.total td { font-weight: 800; background: var(--vert-clair); }
table.journal tr.total td { font-weight: 700; background: var(--vert-clair); }
.saisie.mini { min-height: 36px; width: 96px; padding: 4px 8px; font-size: 15px; text-align: right; }
.jour-titre h2 .jour-court { font-size: 12px; margin-top: 2px; }

.controle table.journal td.col-date, .controle table.journal th.col-date { white-space: normal; min-width: 130px; max-width: 150px; font-size: 13px; line-height: 1.25; padding-block: 6px; }
.controle table.journal td { height: auto; }
table.journal.fiche td.chiffre { white-space: nowrap; }

/* ───────────── Bascule d'espace (conducteur / admin / propriétaire) ───────────── */
.bascule { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--vert-clair); border: 1px solid #BFD8CD; }
.bascule button { min-height: 44px; border: 0; border-radius: 9px; background: transparent; font-weight: 700; color: var(--vert); }
.bascule button[aria-selected="true"] { background: var(--vert); color: #fff; }
.grille-ancien { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }

/* une carte ne doit jamais élargir la page : le tableau défile dans sa zone */
.carte { min-width: 0; max-width: 100%; }
.controle { min-width: 0; max-width: 100%; }
.controle .table-zone { max-width: 100%; }

/* ───────────── Accueil : service en cours ───────────── */
.service-en-cours { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 12px; margin: 4px 0 10px; border-radius: 10px; background: var(--vert-clair); border: 1px solid #BFD8CD; }
.service-en-cours > div { display: flex; flex-direction: column; }
.service-en-cours b { font-size: 1.35rem; }
.alerte.bandeau { width: 100%; text-align: left; font: inherit; cursor: pointer; display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

/* ───────────── Contrôles et alertes ───────────── */
.liste-alertes { display: flex; flex-direction: column; }
.alerte-reglage { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--trait); }
.alerte-reglage:first-child { border-top: 0; }
.interrupteur { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; cursor: pointer; }
.interrupteur input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.interrupteur .curseur { flex: none; width: 46px; height: 28px; border-radius: 14px; background: #C9D3CE; position: relative; transition: background .15s; }
.interrupteur .curseur::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.interrupteur input:checked + .curseur { background: var(--vert); }
.interrupteur input:checked + .curseur::after { transform: translateX(18px); }
.interrupteur input:focus-visible + .curseur { outline: 3px solid var(--accent, #D9A33A); outline-offset: 2px; }
.interrupteur .texte { display: flex; flex-direction: column; min-width: 0; }
.interrupteur .texte small { color: var(--doux, #5E6E67); font-size: .82rem; }
.alerte-reglage .saisie.mini { width: 78px; flex: none; text-align: center; }
.seuil-fixe { flex: none; display: flex; flex-direction: column; align-items: center; font-family: var(--chiffres); font-weight: 700; }
.seuil-fixe small { font-family: inherit; font-weight: 400; font-size: .7rem; color: var(--doux, #5E6E67); }

/* ───────────── Menus avec icônes ───────────── */
.menu button .ico { flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--vert-clair); display: grid; place-items: center; }
.menu button .ico svg, .ico-petit svg { width: 22px; height: 22px; stroke: var(--vert); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.menu button .txt { display: block; min-width: 0; }
.titre-menu { margin: 18px 4px 8px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--doux); }
.titre-ecran { margin: 4px 0 12px; }
.ico-petit { flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--vert-clair); display: grid; place-items: center; }
.info.large { grid-column: 1 / -1; }
.info.large b { font-size: 18px; }
.info b span { font-size: inherit; color: inherit; }
.info b .passe { color: var(--doux); font-weight: 500; text-decoration: line-through; text-decoration-thickness: 1px; }
tr.cliquable { cursor: pointer; }
tr.hors td { color: var(--doux); }

/* ───────────── Espaces admin / propriétaire : en-tête d'une autre couleur ───────────── */
.pastille.espace { font-weight: 700; }
body[data-espace="admin"] .entete { background: #3A3F73; }
body[data-espace="proprietaire"] .entete { background: #5B2E4F; }
body[data-espace="admin"] .onglets button[aria-selected="true"] { color: #3A3F73; border-top-color: #3A3F73; }
body[data-espace="proprietaire"] .onglets button[aria-selected="true"] { color: #5B2E4F; border-top-color: #5B2E4F; }

/* en-tête : l'espace sous le titre */
.titre-bloc { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.titre-bloc h1 { flex: none; max-width: 100%; }
.espace-lien { border: 0; background: none; color: #fff; opacity: .9; font: inherit; font-size: 12.5px; font-weight: 600; padding: 2px 0; min-height: 24px; }
.espace-lien[hidden] { display: none; }
body[data-espace="admin"]::before { background: #3A3F73; }
body[data-espace="proprietaire"]::before { background: #5B2E4F; }
.chiffres-cles.trois { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ligne-fiche { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; display: flex; align-items: center; gap: 10px; padding: 10px 2px; min-height: 52px; }
.ligne-fiche small, .compte-ligne small { display: block; color: var(--doux); font-size: 12.5px; }
.compte-ligne { min-width: 0; overflow-wrap: anywhere; }
.fiches-annee > * + * { border-top: 1px solid var(--trait); }

.bascule { margin-bottom: 14px; }
.bascule button { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; }
.bascule svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
body[data-espace="admin"] .bascule button[aria-selected="true"] { background: #3A3F73; }
body[data-espace="proprietaire"] .bascule button[aria-selected="true"] { background: #5B2E4F; }

/* liens « aller à » dans les messages */
.lien-aller { display: inline; border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left; }
.champ.surligne { border-radius: 10px; box-shadow: 0 0 0 3px var(--orange); transition: box-shadow .3s; }
.droite { text-align: right; margin: 4px 2px 0; }

/* versions et améliorations */
.num-version { flex: none; font-family: var(--chiffres); font-weight: 700; font-size: 13px; padding: 3px 8px; border-radius: 8px; background: var(--vert-clair); color: var(--vert); }
.version.actuelle { border: 2px solid var(--cadre); }
.version.actuelle .num-version { background: var(--vert); color: #fff; }
.version h3 { margin: 0; }
.puces { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.idees > div { display: flex; align-items: center; gap: 10px; }
.etoile { flex: none; width: 40px; height: 40px; border: 0; background: none; font-size: 22px; color: #C9A227; cursor: pointer; }
.etat.prevu { background: #E6ECFA; color: #2B4C8C; border-color: #C3D0EE; }
.liste.idees > div { flex-wrap: nowrap; padding: 6px 10px 6px 2px; gap: 6px; }
.liste.idees > div > span:not(.espace):not(.etat) { flex: 1; min-width: 0; }
.liste.idees .espace { display: none; }

/* aide « Comment remplir » */
details.aide { margin: 4px 0 14px; border: 1px solid #C3D0EE; background: #F1F5FD; border-radius: 10px; padding: 0 12px; }
details.aide summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; color: #2B4C8C; }
details.aide summary::-webkit-details-marker { display: none; }
details.aide summary::after { content: '▾'; margin-left: auto; transition: transform .15s; }
details.aide[open] summary::after { transform: rotate(180deg); }
details.aide .ico-aide { width: 22px; height: 22px; border-radius: 50%; background: #2B4C8C; color: #fff; display: grid; place-items: center; font-size: 13px; font-style: italic; font-family: Georgia, serif; }
details.aide ol { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 6px; font-size: 14.5px; }
details.aide p { margin: 0 0 10px; }
.choix-fichier { display: grid; gap: 10px; margin-bottom: 14px; }
.choix-fichier > div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--fond); border: 1px solid var(--trait); }
.choix-fichier span { font-size: 14px; color: var(--doux); }
a.btn.large { display: flex; justify-content: center; text-decoration: none; }
table.colonnes-import td { white-space: normal; text-align: left; font-size: 13.5px; min-width: 160px; }

/* heures réelles du jour */
.tag-reel { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 6px; background: #E6ECFA; color: #2B4C8C; vertical-align: middle; }
details.sous-bloc { margin: 10px 0; border: 1px solid var(--trait); border-radius: 10px; padding: 0 12px; background: var(--fond); }
details.sous-bloc summary { min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; }
details.sous-bloc[open] { padding-bottom: 10px; }
tr.cotis td { font-size: 12.5px; color: var(--doux); }
/* la fiche de paie se lit en entier, sans défilement interne */
.table-zone:has(> table.fiche) { max-height: none; }

/* ───────────── Choix de services ───────────── */
.tag-prevu { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 6px; background: #EEE7F7; color: #5B3E8C; vertical-align: middle; }
.choix-liste > .choix-u { display: flex; align-items: stretch; gap: 4px; padding: 6px 8px 6px 0; flex-wrap: nowrap; }
.choix-u.eviter { background: #FFF8EE; }
.choix-u.exclu { opacity: .55; }
.choix-corps { flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; display: grid; gap: 3px; padding: 4px 0; cursor: pointer; }
.choix-l1 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.choix-l2 { font-size: 13.5px; }
.choix-l3 { font-size: 12.5px; color: var(--doux); }
.choix-raison { font-size: 12px; color: var(--orange); font-weight: 600; }
.choix-u.exclu .choix-raison { color: var(--rouge); }
.choix-net { flex: none; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; min-width: 74px; }
.choix-net small { font-size: 11px; color: var(--doux); }
.liste.voeux > div { flex-wrap: nowrap; gap: 6px; }
.liste.voeux .rang { min-width: 26px; font-family: var(--chiffres); }
.liste.voeux .voeu-txt { flex: 1; min-width: 0; }
.btn-icone.petit { width: 34px; height: 34px; min-height: 34px; font-size: 13px; }
table.comparer td { white-space: normal; font-size: 13px; }
table.formulaire td { white-space: normal; }
textarea.saisie { min-height: 90px; font: inherit; }

.chiffres-cles small.ok-txt { color: var(--ok); font-size: 11px; }
.chiffres-cles small.proche-txt { color: var(--orange); font-size: 11px; }
.chiffres-cles small.ecart-txt { color: var(--rouge); font-size: 11px; }
.net-annee { display: flex; flex-direction: column; align-items: flex-end; }
.net-annee small { color: var(--doux); font-size: 12px; }

/* formulaire de paie */
.formulaire-paie > div { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.formulaire-paie label { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.formulaire-paie label small { color: var(--doux); font-size: 12px; }
.formulaire-paie .saisie.mini { width: 84px; flex: none; text-align: center; }
.formulaire-paie .saisie.mini::placeholder { color: #9AA8A1; }
.saisie.change { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(194,97,0,.18); }

/* ── v16 : accès, invitations, aide, exports ── */
.alerte.bleu { background: #F1F5FD; border-color: #C3D0EE; color: #2B4C8C; }
.bandeau-message { margin-bottom: 12px; align-items: center; }
.bandeau-message .btn-icone { min-width: 36px; min-height: 36px; }
.ico-grand { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 6px; border-radius: 50%; background: var(--fond); }
.ico-grand svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.connexion h2, .connexion > p { text-align: center; }
.liste.comptes > button { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 0; border-top: 1px solid var(--trait); min-height: 56px; background: none; font: inherit; color: inherit; text-align: left; width: 100%; cursor: pointer; }
.liste.comptes > button:first-child { border-top: 0; }
.liste.comptes > button[hidden] { display: none; }
#cpt-cherche { margin-bottom: 10px; width: 100%; }
.etat.e-suspendu { background: var(--rouge-fond); color: #7F1616; border-color: #F2B5B5; }
.message-invitation { white-space: pre-wrap; font: inherit; font-size: 14px; background: var(--fond); border: 1px solid var(--trait); border-radius: 10px; padding: 10px 12px; margin: 8px 0 12px; user-select: all; -webkit-user-select: all; overflow-wrap: anywhere; }
.zone-danger { border-color: #F2B5B5; }
.zone-danger h3 { color: #7F1616; }
details.faq { border-top: 1px solid var(--trait); }
details.faq:first-of-type { border-top: 0; }
details.faq summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; list-style: none; gap: 8px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: '▾'; margin-left: auto; color: var(--doux); transition: transform .15s; }
details.faq[open] summary::after { transform: rotate(180deg); }
details.faq p { margin: 0 0 12px; font-size: 14.5px; }
textarea.saisie { width: 100%; resize: vertical; font: inherit; }

/* Impression : la fiche seule */
@media print {
  header, .onglets, .filtres, .bascule, .non-imprime, details.aide, .bandeau-message, #toast, .btn, .btn-icone { display: none !important; }
  body { background: #fff; }
  .carte { break-inside: avoid; box-shadow: none; }
  input.saisie { border: 0; background: none; }
}

/* ── v17 : compteurs, ponts, net, règles ── */
table.compteurs { width: 100%; border-collapse: collapse; font-size: 14px; }
table.compteurs th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); font-weight: 700; padding: 6px 6px; border-bottom: 1px solid var(--trait); }
table.compteurs td { padding: 8px 6px; border-bottom: 1px solid var(--trait); vertical-align: top; }
table.compteurs td.chiffre, table.compteurs th:nth-child(n+3) { text-align: right; }
.table-defile { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 10px; }
.liste.ponts > div { flex-wrap: nowrap; }
.pont-gain { display: grid; place-items: center; min-width: 52px; height: 52px; border-radius: 12px; background: #E3F3E8; color: #1E5A35; line-height: 1; }
.pont-gain b { font-size: 20px; } .pont-gain small { font-size: 10.5px; }
.pont-txt { min-width: 0; } .pont-txt small { display: block; color: var(--doux); font-size: 12.5px; }
.chiffres-cles.deux { grid-template-columns: 1fr 1fr; }
.chiffres-cles.deux small { display: block; color: var(--doux); font-size: 11.5px; margin-top: 2px; }
.chiffres-cles.deux div:nth-child(2) { border-top: 0 !important; border-left: 1px solid var(--trait) !important; }
.exemple { background: #F1F5FD; border-left: 3px solid #2B4C8C; border-radius: 6px; padding: 8px 10px; margin: 8px 0 12px; font-size: 14px; }
.exemple p { margin: 4px 0 0; }
.grille-anc { display: flex; flex-wrap: wrap; gap: 6px; }
.pastille-grille { font-size: 12.5px; background: var(--fond); border: 1px solid var(--trait); border-radius: 999px; padding: 2px 8px; }
details.regle > *:not(summary) { font-size: 14.5px; }
#x-faceid svg { width: 20px; height: 20px; vertical-align: -4px; fill: none; stroke: currentColor; stroke-width: 2; }
.titre-impression { display: none; }
@media print {
  .titre-impression { display: block; font-size: 16px; margin: 0 0 8px; }
  .table-zone { max-height: none !important; overflow: visible !important; border: 0; }
  table.journal { font-size: 9px; } table.journal th, table.journal td { height: auto; padding: 2px 3px; position: static !important; }
  .jour-titre .btn-icone { display: none; }
  @page { margin: 10mm; }
}
table.compteurs small.sous { display: block; font-size: 11.5px; color: var(--doux); font-weight: 400; }

/* ── v18 : conditions de choix ── */
.gain-cond { display: block; font-size: 12px; color: #2B4C8C; margin-top: 3px; font-weight: 600; }
.alerte-reglage .gain-cond { padding-left: 58px; margin-top: -4px; margin-bottom: 6px; }
.jauge { height: 14px; border-radius: 999px; background: var(--fond); border: 1px solid var(--trait); overflow: hidden; margin: 8px 0; }
.jauge i { display: block; height: 100%; background: linear-gradient(90deg, #2E8A57, #4CB07A); border-radius: 999px; }
ol.plan { margin: 4px 0 8px; padding-left: 22px; display: grid; gap: 4px; font-size: 14.5px; }
.verrou { font-size: 13px; display: inline-flex; gap: 6px; align-items: center; color: var(--doux); }
.verrou input { width: 20px; height: 20px; }
.cond-section h4, .jauge-carte h4 { margin: 12px 0 6px; font-size: 14px; }
.liste.voeux > div.en-trop { background: var(--rouge-fond); }
b.vert { color: #1E5A35; }
.alerte-reglage { flex-wrap: wrap; }
.alerte-reglage .gain-cond { flex-basis: 100%; padding-left: 58px; margin: -6px 0 8px; }

/* ── v18 : dates passées, en cours, à venir ── */
table.journal tr.passe td.col-date { background: #ECEFEC; color: #5B6B60; }
table.journal tr.passe td.col-date .jour-court { color: #7C8A80; }
table.journal tr.avenir td.col-date { background: #F4F8FF; }
table.journal .annee { display: block; font-size: 10.5px; font-weight: 600; color: var(--doux); }
.liste > div.passe { background: #F1F3F1; color: #5B6B60; }
.liste > div.passe b { color: #4A584E; }
.liste > div.encours { background: #E3F3E8; box-shadow: inset 4px 0 0 #2E8A57; }
.liste > div.avenir { box-shadow: inset 4px 0 0 #2B4C8C; }

/* ── v19 : lecture des PDF ── */
.depot-pdf { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0 14px; cursor: pointer; }
.depot-pdf svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.chiffres-cles.compact b { font-size: 15px; }

/* ── v19 : comparaison avec les PDF ── */
.boutons-pdf { gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.boutons-pdf .btn { display: inline-flex; align-items: center; gap: 8px; flex: 1; justify-content: center; cursor: pointer; }
.boutons-pdf svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.comparer-pdf h4 { margin: 14px 0 6px; font-size: 14px; }
table.comparaison tr.egal td:last-child { color: #1E5A35; }
table.comparaison tr.ecart td { background: #FFF6E8; }
table.comparaison tr.ecart td:last-child { color: #7A3E00; }
table.comparaison tr.ecart-fort td { background: #FDECEC; }
table.comparaison tr.ecart-fort td:last-child { color: #7F1616; }
table.comparaison tr.total td { border-top: 2px solid var(--trait); }
.liste.diffs-jours > div { background: #FFF6E8; flex-wrap: nowrap; }
.liste.diffs-jours small { line-height: 1.45; }
table.comparaison { font-size: 13px; }
table.comparaison td.chiffre, table.comparaison th { white-space: nowrap; }
table.comparaison td, table.comparaison th { padding: 7px 4px; }
table.comparaison td:first-child { min-width: 0; }
