/* ADIA Tempo — feuille de style unique.
   Palette : fond clair #F6F8F7, vert sauge #8FBC8F (vif) / #4F7D57 (texte), bleu profond #123B63,
   encre #16212E. Mode sombre par variables. Les surcharges d'écran étroit sont EN FIN DE FICHIER. */

:root {
  --ground: #F6F8F7;
  --panel: #FFFFFF;
  --panel-2: #EEF3F0;
  --ink: #16212E;
  --muted: #5D6B7A;
  --line: #DCE5DF;
  --navy: #123B63;
  --navy-2: #0A2036;
  --navy-ink: #E8EEF6;
  --accent: #4F7D57;
  --accent-vif: #8FBC8F;
  --accent-doux: #E7F1E7;
  --accent-ink: #11261A;
  --bleu: #123B63;
  --bleu-doux: #E4ECF5;
  --rouge: #B3402F;
  --rouge-doux: #FBEBE8;
  --ambre: #8A6300;
  --ambre-doux: #FDF3DC;
  --vert: #2F6B45;
  --vert-doux: #E3F2E8;
  --ombre: 0 1px 2px rgba(18, 59, 99, .06), 0 8px 24px rgba(18, 59, 99, .06);
  --rayon: 14px;
  --transition: .22s ease;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0F1715;
    --panel: #172220;
    --panel-2: #1E2B28;
    --ink: #E6ECE8;
    --muted: #9AAAA0;
    --line: #2A3936;
    --navy: #0A2036;
    --navy-2: #060F1C;
    --navy-ink: #E8EEF6;
    --accent: #A7D2A7;
    --accent-vif: #8FBC8F;
    --accent-doux: #1C2E21;
    --accent-ink: #0B1A10;
    --bleu: #9DBBE0;
    --bleu-doux: #16263A;
    --rouge: #E2735F;
    --rouge-doux: #2C1A17;
    --ambre: #D9A741;
    --ambre-doux: #2A2213;
    --vert: #7AC89A;
    --vert-doux: #14261E;
    --ombre: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] {
  --ground: #0F1715; --panel: #172220; --panel-2: #1E2B28; --ink: #E6ECE8; --muted: #9AAAA0;
  --line: #2A3936; --navy: #0A2036; --navy-2: #060F1C; --navy-ink: #E8EEF6;
  --accent: #A7D2A7; --accent-vif: #8FBC8F; --accent-doux: #1C2E21; --accent-ink: #0B1A10;
  --bleu: #9DBBE0; --bleu-doux: #16263A; --rouge: #E2735F; --rouge-doux: #2C1A17;
  --ambre: #D9A741; --ambre-doux: #2A2213; --vert: #7AC89A; --vert-doux: #14261E;
  --ombre: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { overflow-x: hidden; }
body {
  background: var(--ground); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px; line-height: 1.55; -webkit-text-size-adjust: 100%;
  min-height: 100vh; overflow-x: hidden;
}
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
h2 { font-size: 18px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 15px; margin-bottom: 6px; }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--accent-vif); outline-offset: 2px; }
.picto { flex: 0 0 auto; vertical-align: -0.2em; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- charpente ---------- */

#appli { min-height: 100vh; display: flex; flex-direction: column; }

.bandeau-demo {
  background: var(--ambre-doux); color: var(--ambre); text-align: center;
  font-size: 13.5px; font-weight: 600; padding: 6px 16px; border-bottom: 1px solid var(--ambre);
}

.barre {
  background: linear-gradient(180deg, var(--navy), var(--navy-2));
  color: var(--navy-ink); padding: 10px 18px; min-height: 58px;
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 20;
}
.barre .marque { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.barre .marque img { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 9px; background: #fff; object-fit: contain; }
.barre .marque .textes { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.barre .marque .nom { font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.barre .marque .lieu { color: #A9BBD0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre .personne { margin-left: auto; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }
.barre .bouton.discret { background: rgba(255,255,255,.12); color: #E8EEF6; border-color: rgba(255,255,255,.18); }
.barre .bouton.discret:hover { background: rgba(255,255,255,.2); }

.onglets {
  display: flex; gap: 2px; background: var(--panel); border-bottom: 1px solid var(--line);
  padding: 0 10px; position: sticky; top: 58px; z-index: 19; overflow-x: auto; scrollbar-width: none;
}
.onglets::-webkit-scrollbar { display: none; }
.onglets a {
  padding: 13px 14px; text-decoration: none; color: var(--muted); font-weight: 500;
  border-bottom: 3px solid transparent; white-space: nowrap; transition: color var(--transition);
}
.onglets a:hover { color: var(--ink); }
.onglets a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent-vif); }
/* Le lien « ? » discret vers la section du manuel de l'écran affiché (§16) */
.onglets .lien-aide { margin-left: auto; padding: 11px 12px; font-weight: 600; font-size: 15px; }
.onglets .lien-aide::before { content: ''; }

main { flex: 1; padding: 22px 18px 48px; max-width: 1040px; width: 100%; margin: 0 auto; }
main:focus { outline: none; }
.titre-page { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.titre-page h1 { font-size: 26px; flex: 1 1 auto; }
.sous-titre { color: var(--muted); margin-bottom: 18px; }
.titre-section { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 10px; }
.colonne-etroite { max-width: 480px; margin: 12px auto 0; display: grid; gap: 16px; }
.titre-connexion { font-size: 24px; margin-bottom: 4px; }
.sous-section { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 8px; }

.pied {
  padding: 18px; text-align: center; color: var(--muted); font-size: 13.5px;
  border-top: 1px solid var(--line); background: var(--panel);
}
.pied .mention { max-width: 70ch; margin: 0 auto 8px; }
.pied .liens { display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; }
.pied .liens a { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- notifications ---------- */

.notifications {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: grid; gap: 8px; z-index: 50; width: min(92vw, 460px); pointer-events: none;
}
.notification {
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--accent-vif);
  border-radius: 12px; padding: 12px 16px; box-shadow: var(--ombre);
  opacity: 0; transform: translateY(8px); transition: opacity var(--transition), transform var(--transition);
}
.notification.visible { opacity: 1; transform: none; }
.notification.succes { border-left-color: var(--vert); }
.notification.warn { border-left-color: var(--ambre); }
.notification.alerte { border-left-color: var(--rouge); }

/* ---------- éléments communs ---------- */

.carte { background: var(--panel); border: 1px solid var(--line); border-radius: var(--rayon); box-shadow: var(--ombre); }
.bloc { padding: 18px 20px; }
.sous-bloc { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }

.bandeau {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 12px;
  margin-bottom: 14px; border: 1px solid transparent; background: var(--panel-2);
}
.bandeau .picto { margin-top: 2px; }
.bandeau strong { color: inherit; }
.bandeau.info { background: var(--accent-doux); border-color: var(--accent-vif); color: var(--ink); }
.bandeau.succes { background: var(--vert-doux); border-color: var(--vert); color: var(--vert); }
.bandeau.alerte { background: var(--rouge-doux); border-color: var(--rouge); color: var(--rouge); }
.bandeau.warn { background: var(--ambre-doux); border-color: var(--ambre); color: var(--ambre); }
.bandeau[hidden] { display: none; }

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px;
  min-height: 44px; background: var(--panel-2); color: var(--ink); border: 1px solid var(--line);
  border-radius: 11px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: filter var(--transition), background var(--transition), transform .1s ease;
}
.bouton:hover { filter: brightness(1.04); }
.bouton:active { transform: translateY(1px); }
.bouton.principal { background: var(--accent-vif); color: var(--accent-ink); border-color: transparent; }
.bouton.secondaire { background: var(--bleu-doux); color: var(--bleu); border-color: transparent; }
.bouton.discret { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.bouton.danger { background: var(--rouge-doux); color: var(--rouge); border-color: transparent; }
.bouton.fin { padding: 6px 12px; min-height: 36px; font-size: 14px; }
.bouton.large { width: 100%; min-height: 52px; font-size: 17px; }
.bouton:disabled { opacity: .55; cursor: default; filter: none; transform: none; }
.bouton.en-cours { opacity: .8; }

.bouton-pointage {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 96px; padding: 16px 12px;
  background: var(--panel); color: var(--ink); border: 2px solid var(--line); border-radius: 18px;
  font-weight: 600; font-size: 16px; cursor: pointer; box-shadow: var(--ombre);
  transition: transform .12s ease, border-color var(--transition), background var(--transition), opacity var(--transition);
}
.bouton-pointage .verbe { text-align: center; text-wrap: balance; }
.bouton-pointage:hover:not(:disabled) { border-color: var(--accent-vif); }
.bouton-pointage:active:not(:disabled) { transform: scale(.98); }
.bouton-pointage.principal {
  background: var(--accent-vif); color: var(--accent-ink); border-color: var(--accent-vif);
  min-height: 112px; font-size: 18px;
}
.bouton-pointage.principal .picto { width: 36px; height: 36px; }
.bouton-pointage:disabled { cursor: default; opacity: .55; box-shadow: none; }
.bouton-pointage.impossible { background: var(--panel-2); }

.pastille {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; white-space: nowrap; line-height: 1.4;
}
.pastille.grande { font-size: 15px; padding: 6px 14px; }
.pastille.vert { background: var(--vert-doux); color: var(--vert); }
.pastille.bleu { background: var(--bleu-doux); color: var(--bleu); }
.pastille.ambre { background: var(--ambre-doux); color: var(--ambre); }
.pastille.rouge { background: var(--rouge-doux); color: var(--rouge); }
.pastille.gris { background: var(--panel-2); color: var(--muted); }
.pastilles { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }

.tableau { width: 100%; border-collapse: collapse; font-size: 15px; }
.tableau th, .tableau td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.tableau th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau td.nombre { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tableau tr.incomplete td { background: color-mix(in srgb, var(--rouge-doux) 45%, transparent); }
.tableau-carte { padding: 6px 8px; overflow: hidden; }
.tableau-carte .aide { padding: 8px 12px 10px; }
.tableau .vide { padding: 28px; }

.champ { display: grid; gap: 6px; margin-bottom: 14px; }
.champ > span { font-weight: 600; font-size: 14.5px; }
.champ small { font-weight: 400; }
.champ input, .champ select, .champ textarea {
  width: 100%; padding: 11px 13px; min-height: 46px; font: inherit;
  border: 1px solid var(--line); border-radius: 11px; background: var(--panel); color: var(--ink);
}
.champ input:focus, .champ select:focus, .champ textarea:focus { border-color: var(--accent-vif); outline: 3px solid var(--accent-doux); }

.grille { display: grid; gap: 16px; }
.grille.deux { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grille .champ { margin-bottom: 0; }
.ligne-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.ligne-actions.centre { justify-content: center; }

.vide { padding: 36px 20px; text-align: center; color: var(--muted); display: grid; gap: 8px; justify-items: center; }
.vide.petit { padding: 16px; }
.carte.vide { background: var(--panel); }
.aide { color: var(--muted); font-size: 14px; margin-top: 12px; }
.muted { color: var(--muted); }
.petit { font-size: 13.5px; }

.liste-simple { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.liste-simple li {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: var(--panel-2); border-radius: 11px;
}
.liste-simple .quoi { min-width: 0; }
.liste-simple .sec { color: var(--muted); font-size: 13.5px; }
.liste-aide { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 6px; }

.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 6px; }
.chiffre { display: grid; gap: 2px; padding: 12px 14px; background: var(--panel-2); border-radius: 12px; }
.chiffre .cle { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.chiffre .val { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

.anomalies, .explication, .liste-paliers { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.anomalies li { display: flex; gap: 8px; align-items: flex-start; color: var(--ambre); font-size: 14.5px; }
.anomalies .picto { margin-top: 3px; }
.explication li { padding-left: 14px; position: relative; font-size: 14.5px; }
.explication li::before { content: '•'; position: absolute; left: 0; color: var(--accent); }
.anomalie { display: inline-flex; gap: 5px; align-items: center; color: var(--ambre); font-size: 14px; }
.liste-paliers li { font-size: 14.5px; }

.journal { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.journal li { display: grid; grid-template-columns: 150px 1fr; gap: 14px; }
.journal .quand { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------- écran Pointer ---------- */

.accueil { margin-bottom: 20px; }
.entete-accueil { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.entete-accueil h1 { font-size: 30px; margin-bottom: 8px; }
.statut-jour { margin: 0; }
.horloge { text-align: right; }
.horloge .date { color: var(--muted); font-size: 15px; }
.horloge .date::first-letter { text-transform: uppercase; }
.horloge .heure { font-size: 44px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--bleu); letter-spacing: .02em; }

.actions-pointage { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: start; }
.actions-pointage .action { display: grid; gap: 6px; }
.actions-pointage .raison { margin: 0; min-height: 1.2em; font-size: 13px; color: var(--muted); text-align: center; line-height: 1.35; }

.confirmation {
  display: flex; gap: 12px; align-items: center; padding: 14px 18px; margin-bottom: 14px;
  background: var(--vert-doux); color: var(--vert); border: 1px solid var(--vert); border-radius: 12px;
  font-weight: 600; font-size: 17px;
  opacity: 0; transform: translateY(-6px); transition: opacity .35s ease, transform .35s ease;
}
.confirmation.visible { opacity: 1; transform: none; }

.liste-pointages { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.liste-pointages li { display: flex; gap: 12px; align-items: center; padding: 8px 12px; background: var(--panel-2); border-radius: 10px; }
.liste-pointages .heure { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 17px; min-width: 56px; }
.chiffre-principal { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.chiffre-principal .muted { font-size: 15px; font-weight: 500; }

/* Carte « Mon agenda » de l'écran Pointer (§12) : discrète, elle informe et ne bloque jamais. */
.carte-agenda { border-style: dashed; box-shadow: none; }
.carte-agenda h2 { font-size: 16px; color: var(--muted); }
.carte-agenda p { font-size: 15px; }
.carte-agenda .cle { display: inline-block; min-width: 0; margin-right: 6px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.carte-agenda .agenda-aujourdhui { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--bleu-doux); color: var(--bleu); }
.carte-agenda .agenda-aujourdhui .picto { margin-top: 3px; }

/* ---------- Mes heures ---------- */

.navigation-periode { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.navigation-periode .periode { flex: 1 1 220px; text-align: center; display: grid; gap: 2px; }
.navigation-periode .periode a, .navigation-periode .periode .muted { font-size: 13.5px; }
.pointage-court { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pointage-court sup { color: var(--accent); font-weight: 700; }

/* Carte « Votre compteur » (§11) : deux chiffres séparés, le détail replié, les mouvements (annulés grisés). */
.compteur { margin-bottom: 16px; border-left: 4px solid var(--accent-vif); }
.compteur h2 { flex-wrap: wrap; }
.compteur .sous-libelle { font-weight: 500; }
.compteur .chiffres { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); max-width: 420px; }
.details-compteur summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.details-compteur h3 { margin-top: 12px; }
.semaines-compteur { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; font-size: 14.5px; }
.semaines-compteur li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.semaines-compteur .nombre { font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.mouvements tr.annule td { color: var(--muted); }
.mouvements .barre { text-decoration: line-through; }

/* Repère de couleur d'une personne : fond doux de sa teinte, prénom toujours écrit dedans (§13). */
.repere-couleur { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; background: var(--panel-2); color: var(--ink); font-weight: 600; font-size: 15px; }

/* Grille « Mon agenda » (§12, lecture seule) : sept colonnes, une case par jour civil. */
.agenda .chiffres { margin: 12px 0 14px; }
.agenda .petit-val { font-size: 15px; line-height: 1.3; }
.agenda-grille { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.agenda-entete { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; text-align: center; padding: 4px 0; }
.agenda-jour { min-height: 92px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); display: grid; grid-template-rows: auto 1fr; gap: 4px; align-content: start; min-width: 0; font-size: 13px; }
.agenda-jour.hors-mois { border: 0; background: transparent; }
.agenda-jour.weekend { background: var(--panel-2); }
.agenda-jour.calme { color: var(--muted); }
.agenda-jour.aujourdhui { border-color: var(--accent-vif); box-shadow: inset 0 0 0 1px var(--accent-vif); }
.agenda-jour.planifie { border-style: dashed; }
.agenda-date { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.agenda-date .numero { font-weight: 700; font-size: 15px; }
.agenda-date .nom-jour { display: none; color: var(--muted); }
.agenda-date .marque { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); font-weight: 700; }
.agenda-contenu { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; min-width: 0; }
.agenda-contenu .pastille { font-size: 12px; padding: 2px 8px; white-space: normal; text-align: left; }
.agenda-creneau { font-variant-numeric: tabular-nums; white-space: nowrap; }
.agenda-travaille { color: var(--vert); font-weight: 600; }

/* ---------- Mes demandes ---------- */

.formulaire-demande { margin-bottom: 18px; border-color: var(--accent-vif); }
.liste-demandes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.demande .entete-demande { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.demande .entete-demande .pastille { margin-left: auto; }
.demande .decision { margin-top: 8px; padding: 10px 12px; background: var(--panel-2); border-radius: 10px; }
.demande .decision p { margin: 4px 0 0; }
.demo-comptes h2 { font-size: 16px; }

/* ---------- impression ---------- */

@media print {
  .barre, .onglets, .bandeau-demo, .notifications, .navigation-periode .bouton, .ligne-actions { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .carte { box-shadow: none; }
  @page { margin: 12mm; }
}

/* ---------- poste du cabinet (§15) et repère de couleur (§13) ---------- */
/* Tout est dimensionné sans règle d'écran : les tuiles et le pavé se replient d'eux-mêmes
   (2 colonnes à 375 px, 3 à 4 au-delà), aucune barre horizontale. */

.ligne-couleur { height: 4px; flex: 0 0 auto; }

.poste-plein { max-width: 1040px; }
.poste { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.poste > * { min-width: 0; }
.poste-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.poste-marque { display: flex; align-items: center; gap: 12px; min-width: 0; }
.poste-marque img { width: 40px; height: 40px; border-radius: 10px; background: #fff; object-fit: contain; flex: 0 0 auto; }
.poste-marque .textes { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.poste-marque .nom { font-weight: 700; font-size: 17px; }
.poste-horloge { display: flex; align-items: baseline; gap: 10px; margin-left: auto; }
.poste-horloge .date { color: var(--muted); font-size: 15px; }
.poste-horloge .date::first-letter { text-transform: uppercase; }
.poste-horloge .heure { font-size: 40px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--bleu); letter-spacing: .02em; }
.poste-titre { font-size: 28px; }
.poste-pied { display: flex; justify-content: center; margin-top: 8px; }
.poste-rebours { text-align: center; min-height: 1.4em; margin: 4px 0 0; }

/* Les tuiles : prénom + couleur + état, grandes et tactiles. 160 px au moins par tuile → 2 colonnes à 375 px, 4 au plus. */
.poste-tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; width: 100%; max-width: 820px; }
.poste-tuile {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 10px;
  min-height: 132px; padding: 16px 16px 14px; text-align: left; cursor: pointer;
  background: var(--teinte-douce, var(--panel)); color: var(--ink);
  border: 2px solid var(--line); border-top: 8px solid var(--teinte, var(--line)); border-radius: 18px;
  box-shadow: var(--ombre); transition: transform .12s ease, border-color var(--transition);
}
.poste-tuile:hover { border-color: var(--teinte, var(--accent-vif)); }
.poste-tuile:active { transform: scale(.98); }
.poste-tuile .prenom { font-size: 24px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.poste-tuile .pastille { white-space: normal; text-align: left; }
.poste-tuile .code-demo { margin-top: auto; }

/* L'identité de la personne choisie : son prénom, toujours écrit, sur sa couleur. */
.poste-identite {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px;
  background: var(--teinte-douce, var(--panel-2)); border-left: 8px solid var(--teinte, var(--line)); border-radius: 12px;
}
.poste-identite .prenom { font-size: 24px; font-weight: 700; }
.poste-identite.grande .prenom { font-size: 30px; }

/* Le pavé numérique : gros chiffres, points masqués. */
.poste-code { display: grid; gap: 14px; justify-items: center; max-width: 360px; margin: 0 auto; width: 100%; }
.poste-code .poste-identite { width: 100%; }
.poste-code .bandeau { width: 100%; margin-bottom: 0; }
.poste-consigne { margin: 0; color: var(--muted); }
.poste-points { display: flex; gap: 14px; min-height: 28px; align-items: center; }
.poste-points .point { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); background: transparent; transition: background var(--transition); }
.poste-points .point.plein { background: var(--bleu); border-color: var(--bleu); }
.poste-points .point.facultatif { opacity: .35; }
.poste-pave { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.poste-touche {
  min-height: 68px; font-size: 30px; font-weight: 600; cursor: pointer;
  background: var(--panel); color: var(--ink); border: 2px solid var(--line); border-radius: 16px; box-shadow: var(--ombre);
  transition: transform .1s ease, border-color var(--transition), background var(--transition);
}
.poste-touche:hover:not(:disabled) { border-color: var(--accent-vif); }
.poste-touche:active:not(:disabled) { transform: scale(.96); }
.poste-touche:disabled { opacity: .45; cursor: default; box-shadow: none; }
.poste-touche.texte { font-size: 17px; }
.poste-touche.valider { background: var(--accent-vif); color: var(--accent-ink); border-color: var(--accent-vif); }

/* La session : boutons de pointage, pointages du jour, volets. */
.poste-session { display: grid; gap: 16px; }
.poste-session #poste-messages:empty { display: none; }
.poste-session .bandeau, .poste-session .confirmation { margin-bottom: 0; }
.poste-actions-secondaires { margin-top: 0; }
.poste-volet { border-color: var(--accent-vif); }
.poste-volet .grille { margin-bottom: 4px; }

/* ---------- manuel (§16) : « Aide et informations », à l'écran et à l'impression ---------- */
/* Sommaire, filtres et sections se replient d'eux-mêmes (aucune règle d'écran, aucune barre horizontale). */

.manuel { max-width: 920px; margin: 0 auto; }
.manuel .manuel-outils { flex-wrap: wrap; align-items: center; margin: 0 0 16px; }
.manuel .manuel-outils .bouton { white-space: normal; text-align: left; }
.manuel .manuel-filtres { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; margin-bottom: 8px; }
.manuel .manuel-recherche { flex: 1 1 240px; margin-bottom: 0; }
.manuel .manuel-segments { display: flex; flex-wrap: wrap; gap: 6px; }
.manuel .manuel-repere { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.manuel .manuel-pastille { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; border: 2px solid var(--line); color: var(--ink); font-weight: 600; font-size: 15px; }
.manuel .manuel-groupe h3 { margin: 14px 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.manuel .manuel-sommaire { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.manuel .manuel-sommaire a { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.manuel .manuel-sommaire a:hover { background: var(--panel-2); }
.manuel .manuel-sommaire a .muted { font-size: 14px; overflow-wrap: anywhere; }
.manuel .manuel-section { margin-top: 16px; scroll-margin-top: 112px; }
.manuel .manuel-section > * { min-width: 0; overflow-wrap: anywhere; }
.manuel .manuel-public { margin: 0 0 2px; text-transform: uppercase; letter-spacing: .05em; }
.manuel .manuel-resume { margin-bottom: 10px; }
.manuel .manuel-section .liste-aide li { margin: 4px 0; }
.manuel .manuel-liens { margin-top: 12px; margin-bottom: 0; }
.manuel .manuel-mention { margin-top: 20px; }

@media print {
  /* Le manuel s'imprime en entier, sections dépliées, sans sommaire interactif ni boutons. */
  .manuel .manuel-outils, .manuel .manuel-filtres, .manuel .manuel-liens, .manuel [data-effacer], .pied .liens { display: none !important; }
  .manuel { max-width: none; }
  .manuel .manuel-section { break-inside: avoid; page-break-inside: avoid; border: 0; border-top: 1px solid #C9D1CC; border-radius: 0; margin-top: 10mm; padding: 6mm 0 0; }
  .manuel .manuel-entree { border: 0; padding: 0; }
  .manuel .manuel-sommaire a { padding: 1mm 0; color: #16212E; }
  .manuel .manuel-sommaire a .muted { color: #5D6B7A; }
  .manuel .manuel-public { color: #5D6B7A; }
  .manuel .manuel-pastille { border: 1px solid #16212E; background: none !important; }
  .manuel h1 { font-size: 22pt; }
  .manuel h2 { font-size: 15pt; color: #123B63; }
  .manuel .bandeau { border: 1px solid #C9D1CC; background: none; }
  .manuel .sous-titre, .manuel .aide { color: #5D6B7A; }
}

/* ---------- écrans étroits : toujours en fin de feuille ---------- */
@media (max-width: 640px) {
  main { padding: 16px 12px 40px; }
  .barre { padding: 8px 12px; gap: 10px; }
  .barre .marque .lieu { display: none; }
  .barre .personne { max-width: 22vw; }
  /* Smartphone : toutes les rubriques restent visibles, sur deux rangées s'il le faut (rien de caché hors champ). */
  .onglets { top: 54px; padding: 0 4px; flex-wrap: wrap; overflow-x: visible; row-gap: 0; }
  .onglets a { padding: 11px 8px; flex: 1 1 auto; text-align: center; font-size: 15px; }
  .titre-page h1 { font-size: 22px; }
  .bloc { padding: 14px 14px; }
  .entete-accueil { flex-direction: column; gap: 8px; }
  .entete-accueil h1 { font-size: 26px; }
  .horloge { text-align: left; width: 100%; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
  .horloge .heure { font-size: 38px; }
  .horloge .date { order: -1; width: 100%; }
  .actions-pointage { grid-template-columns: 1fr 1fr; gap: 10px; }
  .bouton-pointage { min-height: 88px; font-size: 15px; padding: 12px 8px; }
  .bouton-pointage.principal { min-height: 100px; font-size: 16px; }
  .chiffre .val { font-size: 19px; }
  .journal li { grid-template-columns: 1fr; gap: 2px; }
  .colonne-etroite { margin-top: 4px; }
  .notifications { bottom: 12px; }

  /* tableaux empilés : chaque ligne devient une petite fiche, aucune barre horizontale */
  .tableau.empilable thead { display: none; }
  .tableau.empilable, .tableau.empilable tbody, .tableau.empilable tr, .tableau.empilable td { display: block; width: 100%; }
  .tableau.empilable tr { padding: 8px 4px; border-bottom: 1px solid var(--line); }
  .tableau.empilable tr:last-child { border-bottom: 0; }
  .tableau.empilable td { border: 0; padding: 4px 8px; display: grid; grid-template-columns: 96px 1fr; gap: 8px; align-items: baseline; }
  .tableau.empilable td::before { content: attr(data-libelle); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
  .tableau.empilable td[data-libelle=""]::before { content: ''; }
  .tableau.empilable td[data-libelle="Date"], .tableau.empilable td[data-libelle="Semaine"] { grid-template-columns: 1fr; font-size: 16px; }
  .tableau.empilable td[data-libelle="Date"]::before, .tableau.empilable td[data-libelle="Semaine"]::before { display: none; }
  .pointage-court { white-space: normal; }

  /* Mon agenda sur smartphone : une ligne par jour (le nom du jour remplace l'en-tête des colonnes), rien ne déborde. */
  .agenda-grille { display: block; }
  .agenda-entete, .agenda-jour.hors-mois { display: none; }
  .agenda-jour { min-height: 0; grid-template-rows: none; grid-template-columns: 76px 1fr; gap: 8px; margin-bottom: 4px; font-size: 14px; }
  .agenda-jour.calme { padding: 4px 6px; }
  .agenda-date { align-content: start; }
  .agenda-date .nom-jour { display: inline; }
  .agenda-date .marque { flex-basis: 100%; }
  .agenda-contenu { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
  .agenda .chiffres { grid-template-columns: 1fr 1fr; }
  .compteur .chiffres { max-width: none; grid-template-columns: 1fr 1fr; }
  .carte-agenda .cle { display: block; margin-bottom: 2px; }
}
