/* =====================================================================
   Espace Salariés — SARL PINTO
   Pensé d'abord pour le téléphone, puis élargi pour l'ordinateur (voir « @media »).
   Les couleurs sont des « variables » : on les change ici, tout suit.
   ===================================================================== */
:root {
  --marine: #17324d;      /* bleu nuit : barre du haut */
  --bleu: #1f4e79;        /* bleu SARL PINTO : boutons, liens */
  --bleu-clair: #e7eff8;
  --bois: #b9772f;        /* couleur bois, reprise du logo */
  --bois-clair: #f7ebda;
  --fond: #f5f2ed;        /* fond chaud, légèrement crème */
  --carte: #ffffff;
  --texte: #1d2733;
  --discret: #5f6b78;
  --bord: #e7e1d7;
  --bord-fort: #d3cabd;
  --rouge: #b42318;
  --rouge-fond: #fdecea;
  --vert: #146c2e;
  --vert-fond: #e6f4ea;
  --orange: #8a4b00;
  --orange-fond: #fff3dd;
  --info: #1f4e79;
  --info-fond: #e7eff8;
  --lien: #1f4e79;
  --ombre: 0 1px 2px rgba(23, 50, 77, .06), 0 6px 18px rgba(23, 50, 77, .06);
  --rayon: 16px;
  --hauteur-onglets: 68px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0f141a; --carte: #18202a; --texte: #e8edf3; --discret: #9aa8b8;
    --bord: #2a3542; --bord-fort: #3a4757; --bleu-clair: #1a2c40; --bois-clair: #33261a; --bois: #e0a35e;
    --rouge: #ff8a80; --rouge-fond: #3a1714; --vert: #7ad69a; --vert-fond: #12301c;
    --orange: #ffc266; --orange-fond: #3a2a0f; --info: #8cc4ff; --info-fond: #142538; --lien: #8cc4ff;
    --ombre: 0 1px 2px rgba(0, 0, 0, .3);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 16.5px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--lien); text-underline-offset: 2px; }
h1 { font-size: 1.45rem; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; margin: 0 0 16px; }
h2 { font-size: 1.12rem; font-weight: 700; margin: 22px 0 10px; }
h2:first-child { margin-top: 0; }
h3 { font-size: 1rem; margin: 24px 0 4px; }
.invisible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Icônes (public/icones.svg) */
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

/* ---- Barre du haut ---- */
.barre {
  position: sticky; top: 0; z-index: 40; color: #fff;
  background: linear-gradient(120deg, var(--marine) 0%, var(--bleu) 100%);
  padding-top: env(safe-area-inset-top);
  box-shadow: 0 2px 10px rgba(23, 50, 77, .18);
}
.barre-interieur { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.barre a { color: #fff; text-decoration: none; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; flex: none; white-space: nowrap; }
.logo img { border-radius: 10px; flex: none; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.logo span { display: flex; flex-direction: column; line-height: 1.15; }
.logo small { font-size: .66rem; font-weight: 700; letter-spacing: .16em; opacity: .75; }
.compte-rapide { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.compte-rapide form { margin: 0; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .16); border: 2px solid rgba(255, 255, 255, .35);
  font-weight: 800; font-size: .85rem; letter-spacing: .03em;
}
.avatar.actif, .avatar:hover { background: #fff; color: var(--marine) !important; }
.bouton-icone {
  width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent; color: #fff;
  display: grid; place-items: center; cursor: pointer;
}
.bouton-icone:hover { background: rgba(255, 255, 255, .14); }

/* ---- Onglets : barre fixe en BAS de l'écran sur téléphone (comme une appli) ---- */
.onglets {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--carte); border-top: 1px solid var(--bord);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 18px rgba(23, 50, 77, .08);
}
.onglets a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none;
  color: var(--discret); font-size: .68rem; font-weight: 600; padding: 2px 0; min-width: 0;
}
.onglet-icone { position: relative; display: inline-flex; padding: 4px 16px; border-radius: 99px; transition: background .15s; }
.onglets a.actif { color: var(--bleu); }
.onglets a.actif .onglet-icone { background: var(--bleu-clair); }
@media (prefers-color-scheme: dark) { .onglets a.actif { color: #8cc4ff; } }
.onglets-haut { display: none; }
.onglet-texte { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.onglet-texte .long { display: none; }
.onglet-icone .pastille { position: absolute; top: -3px; right: 4px; box-shadow: 0 0 0 2px var(--carte); }
/* Côté admin (6 onglets) : un peu plus serré, seulement sur téléphone / tablette */
@media (max-width: 1099px) {
  .onglets:has(> a:nth-child(6)) .onglet-icone { padding: 4px 12px; }
  .onglets:has(> a:nth-child(6)) a { font-size: .64rem; }
}
body.avec-onglets main { padding-bottom: calc(var(--hauteur-onglets) + 24px + env(safe-area-inset-bottom)); }
body.avec-onglets .pied { padding-bottom: calc(var(--hauteur-onglets) + 20px + env(safe-area-inset-bottom)); }

.lien { background: none; border: 0; padding: 0; font: inherit; color: var(--lien); cursor: pointer; text-decoration: underline; }
.danger-texte { color: var(--rouge); margin-top: 16px; font-size: .9rem; }

/* ---- Mise en page ---- */
main { padding: 20px 16px; max-width: 1180px; margin: 0 auto; }
.titre-page { margin: 4px 0 18px; }
.carte {
  background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon);
  padding: 20px 18px; box-shadow: var(--ombre); margin-bottom: 16px;
}
.etroite { max-width: 500px; margin-left: auto; margin-right: auto; }
.colonnes { display: grid; gap: 0 16px; align-items: start; }
.deux { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
.deux input, .deux select { min-width: 0; }

/* ---- Formulaires ---- */
label { display: block; font-weight: 600; font-size: .94rem; margin: 16px 0 6px; }
input, select, textarea {
  width: 100%; font: inherit; padding: 12px 14px; border: 1.5px solid var(--bord-fort); border-radius: 12px;
  background: var(--carte); color: var(--texte); transition: border-color .15s, box-shadow .15s;
}
input[type=file] { padding: 10px; background: var(--fond); border-style: dashed; }
input[type=date] { min-height: 50px; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--bleu); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 4px rgba(31, 78, 121, .16); }
::placeholder { color: #9aa3ad; }

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 18px; padding: 12px 20px; min-height: 50px;
  background: var(--bleu); color: #fff; border: 1.5px solid transparent; border-radius: 12px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; text-align: center;
  box-shadow: 0 2px 6px rgba(31, 78, 121, .22); transition: background .15s, transform .05s;
}
.bouton:hover { background: var(--marine); }
.bouton:active { transform: translateY(1px); }
.bouton .ic { width: 20px; height: 20px; }
form > .bouton { width: 100%; }
.bouton.secondaire { background: var(--carte); color: var(--texte); border-color: var(--bord-fort); box-shadow: none; }
.bouton.secondaire:hover { background: var(--fond); }
.bouton.danger { background: var(--rouge); color: #fff; box-shadow: none; }
@media (prefers-color-scheme: dark) { .bouton.danger { background: #b42318; } }

/* ---- Messages d'information ---- */
.alerte { border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; border-left: 4px solid currentColor; }
.alerte p { margin: 4px 0; }
.erreur { background: var(--rouge-fond); color: var(--rouge); }
.succes { background: var(--vert-fond); color: var(--vert); }
.attention { background: var(--orange-fond); color: var(--orange); }
.info { background: var(--info-fond); color: var(--info); }
.aide, .discret { color: var(--discret); font-size: .92rem; }
.code { font: 700 1.4rem/1.2 ui-monospace, Menlo, monospace; letter-spacing: 1px; user-select: all; }

.badge { display: inline-block; background: var(--rouge-fond); color: var(--rouge); border-radius: 99px; padding: 2px 10px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.badge.ok { background: var(--vert-fond); color: var(--vert); }
.badge.attente { background: var(--orange-fond); color: var(--orange); }
.badge.nouveau { background: var(--bois); color: #fff; }

/* ---- Listes ---- */
.entete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.entete h1 { margin: 0; }
.entete .bouton { margin: 0; }
.liste { list-style: none; padding: 0; margin: 8px 0 0; }
.liste li { border-top: 1px solid var(--bord); }
.liste a { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 14px 8px; color: inherit; text-decoration: none; border-radius: 10px; }
.liste a:hover { background: var(--fond); }
.ligne-doc { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ligne-doc a { flex: 1; }
.ligne-doc .danger-texte { margin: 0; }
details.annee { border-top: 1px solid var(--bord); }
details.annee summary { padding: 12px 4px; font-weight: 700; cursor: pointer; }

/* ---- Tuiles (raccourcis) ---- */
.tuiles { display: grid; gap: 10px; }
.tuile {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--carte); border: 1px solid var(--bord); border-radius: 14px;
  text-decoration: none; color: var(--texte); font-weight: 700; transition: border-color .15s, transform .1s, box-shadow .15s;
}
.tuile:hover { border-color: var(--bois); box-shadow: var(--ombre); transform: translateY(-1px); }
.tuile .discret { display: block; font-weight: 400; font-size: .88rem; }
.tuile-icone {
  width: 46px; height: 46px; border-radius: 14px; flex: none; display: grid; place-items: center;
  background: var(--bleu-clair); color: var(--bleu);
}
.tuile-icone.bois { background: var(--bois-clair); color: var(--bois); }
.tuile-icone.vert { background: var(--vert-fond); color: var(--vert); }
.tuile-icone.orange { background: var(--orange-fond); color: var(--orange); }
@media (prefers-color-scheme: dark) { .tuile-icone { color: #8cc4ff; } }
.tuile-texte { flex: 1; min-width: 0; }
.tuile-fleche { color: var(--discret); }
.tuile .pastille { margin-left: 6px; vertical-align: 2px; }

.fiche { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; }
.fiche dt { color: var(--discret); }
.fiche dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.actions form { margin: 0; }
.actions .bouton { width: 100%; margin-top: 10px; }

/* ---- Tableaux : en cartes sur téléphone, en vrai tableau sur ordinateur ---- */
.tableau { width: 100%; border-collapse: collapse; }
.tableau thead { display: none; }
.tableau tr { display: block; border-top: 1px solid var(--bord); padding: 12px 4px; }
.tableau td { display: block; padding: 2px 0; }
.tableau td[data-label]::before { content: attr(data-label) " : "; color: var(--discret); font-size: .9rem; }

/* ---- Tableau de bord ---- */
.bandeau-bienvenue { display: flex; align-items: center; gap: 14px; margin: 4px 0 18px; }
.bandeau-bienvenue h1 { margin: 0; }
.bandeau-bienvenue .discret { margin: 2px 0 0; }
.grand-avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--bois), #d8a15e); color: #fff; font-weight: 800; font-size: 1.15rem;
  box-shadow: 0 3px 10px rgba(185, 119, 47, .35);
}
.chiffres { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.chiffre {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  background: var(--carte); border: 1px solid var(--bord); border-radius: 14px; padding: 14px;
  box-shadow: var(--ombre); color: var(--discret); text-decoration: none; font-size: .86rem; line-height: 1.3;
}
.chiffre strong { font-size: 1.9rem; color: var(--texte); line-height: 1.1; font-weight: 800; }
.chiffre-icone { position: absolute; top: 12px; right: 12px; color: var(--bord-fort); }
.chiffre-icone .ic { width: 20px; height: 20px; }
a.chiffre:hover { border-color: var(--bois); }
.chiffre.attention-chiffre { background: var(--orange-fond); border-color: transparent; color: var(--orange); }
.chiffre.attention-chiffre strong, .chiffre.attention-chiffre .chiffre-icone { color: var(--orange); }
.alerte-chiffre strong { color: var(--rouge); }
.journal { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.journal li { padding: 9px 0; border-top: 1px solid var(--bord); }
.journal li.echec strong { color: var(--rouge); }
.journal .discret { margin-right: 6px; }

/* ---- Vérification de l'import ---- */
.periode { margin-bottom: 12px; }
.pages { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 10px; }
.page { border: 1px solid var(--bord); border-left: 6px solid var(--vert); border-radius: 10px; padding: 12px; display: grid; gap: 8px; }
.page.rouge { border-color: var(--rouge); border-left-width: 6px; background: var(--rouge-fond); }
.page.orange { border-left-color: var(--orange); background: var(--orange-fond); }
.page.ignoree { border-left-color: var(--discret); opacity: .7; }
.page-info { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.page-choix { display: grid; gap: 4px; }
.petit-avert { color: var(--orange); font-size: .88rem; }
.page.rouge .petit-avert { color: var(--rouge); }
.barre-actions {
  position: sticky; bottom: 0; background: var(--carte); padding: 8px 0 12px;
  display: grid; gap: 8px; border-top: 1px solid var(--bord);
}
body.avec-onglets .barre-actions { bottom: calc(var(--hauteur-onglets) + env(safe-area-inset-bottom)); }
.barre-actions .bouton { margin: 0; width: 100%; }

/* ---- Page de connexion ---- */
body.page-connexion {
  min-height: 100vh; min-height: 100dvh;
  background:
    repeating-linear-gradient(100deg, rgba(255, 255, 255, .035) 0 46px, rgba(255, 255, 255, 0) 46px 92px),
    linear-gradient(160deg, var(--marine) 0%, var(--bleu) 70%, #2a6296 100%);
}
body.page-connexion main { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.connexion-carte { width: 100%; max-width: 420px; padding: 32px 26px 26px; margin: 0; border: 0; box-shadow: 0 20px 50px rgba(0, 0, 0, .28); }
.connexion-logo { display: block; margin: -4px auto 14px; border-radius: 22px; box-shadow: 0 8px 22px rgba(23, 50, 77, .3); }
.connexion-carte h1 { text-align: center; margin-bottom: 2px; }
.connexion-sous-titre { text-align: center; color: var(--discret); margin: 0 0 8px; }
.connexion-securite { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 18px 0 0; font-size: .82rem; color: var(--discret); }
.connexion-securite .ic { width: 16px; height: 16px; }
body.page-connexion .pied { color: rgba(255, 255, 255, .7); position: fixed; left: 0; right: 0; bottom: 0; }

/* ================= Ordinateur et tablette ================= */
@media (min-width: 760px) {
  main { padding: 28px 24px; }
  .carte { padding: 24px; }
  h1 { font-size: 1.65rem; }
  .chiffres { grid-template-columns: repeat(4, 1fr); }
  .tuiles { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .tableau thead { display: table-header-group; }
  .tableau tr { display: table-row; padding: 0; }
  .tableau th { text-align: left; color: var(--discret); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; padding: 10px; border-bottom: 1px solid var(--bord); }
  .tableau td { display: table-cell; padding: 13px 10px; border-top: 1px solid var(--bord); }
  .tableau td[data-label]::before { content: none; }
  .tableau tbody tr:hover { background: var(--fond); }
  .page { grid-template-columns: 1fr 1.4fr; align-items: center; }
  .barre-actions { grid-template-columns: auto auto; justify-content: end; }
  .barre-actions .bouton { width: auto; }
  .actions { display: flex; flex-wrap: wrap; gap: 10px; }
  .actions .bouton { width: auto; }
}
@media (min-width: 1000px) {
  .colonnes { grid-template-columns: 1fr 1fr; }
}
/* Grand écran : les onglets remontent dans la barre du haut. */
@media (min-width: 1100px) {
  .onglets-bas { display: none; }
  .onglets-haut {
    position: static; display: flex; gap: 2px; margin-left: 18px;
    background: none; border: 0; box-shadow: none; padding: 0;
  }
  .barre .onglets a { flex-direction: row; gap: 8px; color: rgba(255, 255, 255, .8); font-size: .92rem; padding: 8px 12px; border-radius: 10px; }
  .barre .onglets a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
  .barre .onglets a.actif { background: rgba(255, 255, 255, .16); color: #fff; }
  .onglets a.actif .onglet-icone { background: none; }
  .onglet-icone { padding: 0; }
  .onglet-icone .ic { width: 18px; height: 18px; }
  .onglet-texte .long { display: inline; }
  .onglet-texte .court { display: none; }
  .onglet-icone .pastille { top: -8px; right: -10px; box-shadow: 0 0 0 2px var(--bleu); min-width: 18px; line-height: 18px; font-size: .7rem; padding: 0 5px; }
  body.avec-onglets main { padding-bottom: 28px; }
  body.avec-onglets .pied { padding-bottom: 28px; }
  body.avec-onglets .barre-actions { bottom: 0; }
}

/* Petit bouton "Télécharger" à droite d'un document */
.liste a.bouton-petit {
  flex: none; display: inline-block; padding: 8px 12px; border: 1px solid var(--bord); border-radius: 8px;
  font-size: .9rem; font-weight: 600; color: var(--texte); white-space: nowrap; min-height: 40px;
}
.liste a.bouton-petit:hover { border-color: var(--bleu); background: var(--fond); }
/* Sur téléphone, les boutons passent sous le titre s'il n'y a pas la place */
.ligne-doc { flex-wrap: wrap; }
.ligne-doc > a:first-child { flex: 1 1 180px; }
.boutons-doc { display: flex; flex-wrap: wrap; gap: 8px; flex: 0 1 auto; max-width: 100%; padding: 0 4px 12px; }
.liste .boutons-doc a.bouton-petit { padding: 8px 12px; }
@media (min-width: 760px) { .boutons-doc { padding: 0; } }

/* ================= Messagerie ================= */
.pastille {
  display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 99px;
  background: #e5484d; color: #fff; font-size: .8rem; font-weight: 700; text-align: center; line-height: 22px;
}
.chiffre-important strong { color: #e5484d; }
.deux-actions { display: grid; gap: 10px; margin-bottom: 8px; }
.deux-actions > .bouton { margin: 0; }
.ecrire-a label { margin-top: 0; }
.ligne-formulaire { display: flex; gap: 8px; }
.ligne-formulaire .bouton { margin: 0; }
.conversations a { flex-wrap: nowrap; align-items: center; }
.conv-texte { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.apercu { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.retour { margin: 0 0 4px; }

.conversation .entete { align-items: flex-start; }
.fil {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 62vh; min-height: 200px; overflow-y: auto;
  background: var(--fond); border-radius: 10px; padding: 12px; margin: 8px 0 12px;
}
.jour { align-self: center; font-size: .8rem; color: var(--discret); margin: 8px 0 2px; }
.centre { text-align: center; }
.bulle {
  max-width: 85%; padding: 8px 12px; border-radius: 14px; background: var(--carte);
  box-shadow: 0 1px 1px rgba(0,0,0,.08); overflow-wrap: anywhere;
}
.bulle p { margin: 0; white-space: pre-wrap; }
.bulle.autre { align-self: flex-start; border-bottom-left-radius: 4px; }
.bulle.moi { align-self: flex-end; background: var(--bleu); color: #fff; border-bottom-right-radius: 4px; }
.bulle.moi a { color: #fff; }
.bulle img { display: block; max-width: 100%; max-height: 320px; border-radius: 8px; margin: 2px 0 4px; }
.auteur { display: block; font-size: .78rem; font-weight: 700; color: var(--lien); }
.heure { display: block; text-align: right; font-size: .72rem; opacity: .7; }

.envoi textarea {
  width: 100%; font: inherit; padding: 12px; border: 1px solid var(--bord); border-radius: 8px;
  background: var(--carte); color: var(--texte); resize: vertical;
}
.envoi-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.envoi-actions .bouton { margin-top: 8px; }
.envoi-actions button.bouton { margin-left: auto; }
.bouton-photo { display: inline-flex; align-items: center; margin-bottom: 0; font-weight: 600; }

fieldset.membres { border: 1px solid var(--bord); border-radius: 8px; margin: 16px 0 0; padding: 8px 12px; max-height: 50vh; overflow-y: auto; }
fieldset.membres legend { font-weight: 600; padding: 0 4px; }
label.case { display: flex; gap: 10px; align-items: center; font-weight: 400; margin: 0; padding: 10px 0; border-top: 1px solid var(--bord); }
label.case:first-of-type { border-top: 0; }
label.case input { width: 22px; height: 22px; flex: none; }

@media (min-width: 760px) {
  .deux-actions { grid-template-columns: 1fr auto; align-items: end; }
  .fil { max-height: 60vh; }
  .bulle { max-width: 65%; }
}

/* Pièces jointes et suppression de message */
.piece-jointe {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin: 4px 0;
  border-radius: 8px; background: rgba(0,0,0,.06); text-decoration: none; color: inherit; font-weight: 600;
}
.bulle.moi .piece-jointe { background: rgba(255,255,255,.18); }
.piece-jointe span { overflow-wrap: anywhere; }
.piece-jointe small { font-weight: 400; opacity: .75; white-space: nowrap; }
.supprimer-message { text-align: right; margin: 0; }
.supprimer-message .lien { font-size: .72rem; opacity: .7; color: inherit; }

/* ================= Congés et absences ================= */
.demande { padding: 12px 4px; }
.demande-haut { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.citation { margin: 6px 0; font-style: italic; }
.reponse { margin: 6px 0; padding: 8px 10px; background: var(--fond); border-radius: 8px; }
.annuler { margin: 0; }
.annuler .danger-texte { margin-top: 4px; }
.badge.statut.en_attente, .badge.statut.signalee { background: var(--orange-fond); color: var(--orange); }
.badge.statut.acceptee, .badge.statut.prise_en_compte { background: var(--vert-fond); color: var(--vert); }
.badge.statut.refusee { background: var(--rouge-fond); color: var(--rouge); }
.badge.statut.annulee { background: var(--fond); color: var(--discret); }
.cartes-demandes { display: grid; gap: 12px; }
.demande-admin { border: 1px solid var(--bord); border-left: 6px solid var(--orange); border-radius: 8px; padding: 12px; }
.demande-admin.absence { border-left-color: var(--rouge); }
.demande-admin p { margin: 6px 0; }
.boutons-decision { display: flex; gap: 8px; flex-wrap: wrap; }
.boutons-decision .bouton { margin-top: 8px; flex: 1; }
@media (min-width: 760px) {
  .cartes-demandes { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
}

/* Solde de congés */
.solde { border: 1px solid var(--bord); border-left: 6px solid var(--vert); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.solde.negatif { border-left-color: var(--rouge); }
.solde > strong { display: block; font-size: 1.6rem; line-height: 1.2; }
.solde details { margin-top: 6px; }
.solde summary, #conges summary { cursor: pointer; color: var(--lien); font-size: .92rem; }
.mouvements { list-style: none; padding: 0; margin: 8px 0 0; font-size: .92rem; }
.mouvements li { padding: 6px 0; border-top: 1px solid var(--bord); }
.plus { color: var(--vert); font-weight: 700; }
.moins { color: var(--rouge); font-weight: 700; }
.solde-ligne { margin: 0 0 4px; }
.acquisition { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.acquisition select, .acquisition input { width: auto; }
.acquisition input { width: 6.5em; }
.acquisition .bouton { margin: 0; }
.annuler-conge { margin: 0; }
.annuler-conge .danger-texte { margin-top: 2px; }

/* ================= Samedis et jours fériés ================= */
.tarifs-info { margin: 0 0 8px; }
.navigation-mois { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 8px; }
.navigation-mois h2 { margin: 0; text-align: center; flex: 1; }
.navigation-mois .bouton { margin: 0; min-width: 48px; padding: 10px 14px; }
.calendrier { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.calendrier th { font-size: .78rem; color: var(--discret); font-weight: 600; padding: 2px 0; }
.calendrier td { height: 56px; vertical-align: top; border-radius: 8px; background: var(--fond); padding: 0; text-align: center; position: relative; }
.calendrier td.hors-mois { background: transparent; opacity: .35; }
.calendrier .num { display: block; font-weight: 600; padding-top: 6px; }
.calendrier .etiquette { display: block; font-size: .66rem; font-weight: 700; line-height: 1.1; }
.calendrier td.samedi:not(.hors-mois), .pastille-legende.samedi { background: #e3edf9; }
.calendrier td.ferie:not(.hors-mois) { background: #f3e5f7; }
.calendrier td.aujourdhui { outline: 2px solid var(--bleu); }
.calendrier td.declare-en_attente, .pastille-legende.declare-en_attente { background: var(--orange-fond) !important; color: var(--orange); }
.calendrier td.declare-approuve, .pastille-legende.declare-approuve { background: var(--vert-fond) !important; color: var(--vert); }
.calendrier td.declare-refuse, .pastille-legende.declare-refuse { background: var(--rouge-fond) !important; color: var(--rouge); }
@media (prefers-color-scheme: dark) {
  .calendrier td.samedi:not(.hors-mois), .pastille-legende.samedi { background: #1d3550; }
  .calendrier td.ferie:not(.hors-mois) { background: #3a2342; }
}
/* Toute la case du jour est cliquable ; la vraie case à cocher est invisible mais reste utilisable au clavier. */
.case-jour { display: block; height: 100%; min-height: 56px; margin: 0; cursor: pointer; font-weight: 400; border-radius: 8px; position: relative; }
.case-jour input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.case-jour:has(input:focus-visible) { outline: 3px solid #8cc4ff; }
.case-jour:has(input:checked) { background: var(--bleu); color: #fff; }
.case-jour:has(input:checked)::after { content: "✓"; position: absolute; top: 2px; right: 5px; font-size: .8rem; font-weight: 700; }
.legende { font-size: .82rem; color: var(--discret); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.pastille-legende { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--bord); vertical-align: -2px; }
fieldset.duree { border: 0; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
fieldset.duree legend { font-weight: 600; padding: 0; margin-bottom: 4px; }
fieldset.duree label.case { border: 0; padding: 6px 0; }
.ligne-declaration { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 10px 4px; }
.ligne-declaration form { margin: 0; }
.ligne-declaration .danger-texte { margin: 0; }
.badge.statut-jour.en_attente { background: var(--orange-fond); color: var(--orange); }
.badge.statut-jour.approuve { background: var(--vert-fond); color: var(--vert); }
.badge.statut-jour.refuse { background: var(--rouge-fond); color: var(--rouge); }
.badge.type-samedi { background: #e3edf9; color: var(--bleu); }
.badge.type-ferie { background: #f3e5f7; color: #7a2a8c; }
input.montant { max-width: 9em; padding: 8px; }
.tableau tfoot td { border-top: 2px solid var(--bord); padding-top: 10px; }
.a-valider td:first-child input { width: 22px; height: 22px; }
.calendrier td.dimanche:not(.hors-mois) { background: #fdeee0; }
.badge.type-dimanche { background: #fdeee0; color: #8a4b00; }
@media (prefers-color-scheme: dark) { .calendrier td.dimanche:not(.hors-mois) { background: #3a2a15; } }
.trois { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; }
@media (min-width: 600px) { .trois { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ================= Pied de page, installation ================= */
.pied { text-align: center; color: var(--discret); font-size: .82rem; padding: 8px 16px 28px; }
.installer { text-align: left; }
.icone-appli { display: block; margin: 0 auto 12px; border-radius: 22px; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.installer h1 { text-align: center; }
.etapes { padding-left: 1.3em; }
.etapes li { margin: 6px 0; }
.symbole { white-space: nowrap; }
.deja-installee { display: none; }
.appli-installee .deja-installee { display: block; }
.appli-installee .tuile-installer { display: none; }


/* ================= Accueil ================= */
.fiche-vedette {
  display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--texte);
  background: linear-gradient(120deg, var(--carte) 55%, var(--bois-clair) 100%);
}
.fiche-vedette strong { display: block; font-size: 1.25rem; }
.fiche-vedette .discret { display: block; }
.bouton.petit { margin: 0; min-height: 40px; padding: 8px 14px; font-size: .92rem; }
.tuiles.une-colonne { grid-template-columns: 1fr; }

/* ================= Mes documents ================= */
.docs { list-style: none; padding: 0; margin: 4px 0 0; }
.doc { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 2px; border-top: 1px solid var(--bord); }
.docs li:first-child { border-top: 0; }
.doc .tuile-icone { width: 42px; height: 42px; border-radius: 12px; }
.doc-titre { flex: 1 1 160px; min-width: 0; color: var(--texte); text-decoration: none; }
.doc-titre strong { font-size: 1.02rem; }
.doc-titre .discret { display: block; }
.doc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.doc-actions .ic { width: 18px; height: 18px; }
@media (max-width: 520px) { .doc-actions { width: 100%; padding-left: 56px; } .doc-actions .bouton { flex: 1; } }
details.annee summary { list-style: none; display: flex; align-items: center; gap: 8px; }
details.annee summary::-webkit-details-marker { display: none; }
details.annee summary::before { content: "›"; font-size: 1.3rem; line-height: 1; transition: transform .15s; color: var(--discret); }
details.annee[open] summary::before { transform: rotate(90deg); }
.note-documents { display: flex; gap: 8px; align-items: flex-start; }
.note-documents .ic { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.vide { display: flex; align-items: center; gap: 8px; color: var(--vert); }
.boutons-decision .bouton .ic { width: 18px; height: 18px; }

/* =====================================================================
   Finitions « appli moderne » : verre dépoli, animations, écrans vides
   ===================================================================== */

/* ---- Petits éléments communs ---- */
.lien-retour { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; text-decoration: none; color: var(--discret); padding: 4px 8px 4px 2px; border-radius: 8px; }
.lien-retour:hover { color: var(--lien); background: var(--fond); }
.lien-retour .ic { width: 18px; height: 18px; }
.titre-icone { display: flex; align-items: center; gap: 12px; }
.titre-icone .tuile-icone { width: 44px; height: 44px; }
.avec-icone { display: inline-flex; align-items: center; gap: 6px; }
.avec-icone .ic { width: 18px; height: 18px; }
.alerte > .ic, .alerte .avec-icone .ic { width: 18px; height: 18px; vertical-align: -3px; }
.symbole .ic { width: 18px; height: 18px; vertical-align: -3px; }
.navigation-mois .bouton .ic { width: 20px; height: 20px; }

/* ---- Verre dépoli (comme sur iPhone) : on devine le contenu qui défile dessous ---- */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  /* (La barre d'onglets du téléphone est en dehors de l'en-tête : le flou ne la décale pas.) */
  .barre {
    background: linear-gradient(120deg, rgba(23, 50, 77, .93) 0%, rgba(31, 78, 121, .9) 100%);
    -webkit-backdrop-filter: saturate(170%) blur(16px);
    backdrop-filter: saturate(170%) blur(16px);
  }
  .onglets {
    background: rgba(255, 255, 255, .84);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
  }
  @media (prefers-color-scheme: dark) { .onglets { background: rgba(24, 32, 42, .86); } }
  @media (min-width: 1100px) { .onglets-haut { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; } }
}

/* ---- Animations douces ---- */
/* Passage en fondu d'une page à l'autre (navigateurs récents) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }

@keyframes apparition {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes rebond {
  0% { transform: scale(.4); } 60% { transform: scale(1.15); } 100% { transform: scale(1); }
}
@keyframes flotter {
  0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); }
}
/* Les blocs de la page apparaissent l'un après l'autre */
main > *, .tuiles > *, .chiffres > *, .docs > li, .cartes-demandes > *, .pages > li, .conversations > li {
  animation: apparition .45s cubic-bezier(.2, .7, .2, 1) both;
}
main > :nth-child(2), .tuiles > :nth-child(2), .chiffres > :nth-child(2), .docs > :nth-child(2), .cartes-demandes > :nth-child(2), .conversations > :nth-child(2) { animation-delay: .04s; }
main > :nth-child(3), .tuiles > :nth-child(3), .chiffres > :nth-child(3), .docs > :nth-child(3), .cartes-demandes > :nth-child(3), .conversations > :nth-child(3) { animation-delay: .08s; }
main > :nth-child(4), .tuiles > :nth-child(4), .chiffres > :nth-child(4), .docs > :nth-child(4), .cartes-demandes > :nth-child(4), .conversations > :nth-child(4) { animation-delay: .12s; }
main > :nth-child(5), .tuiles > :nth-child(5), .chiffres > :nth-child(5), .docs > :nth-child(5), .conversations > :nth-child(5) { animation-delay: .16s; }
main > :nth-child(n+6), .tuiles > :nth-child(n+6), .chiffres > :nth-child(n+6), .docs > :nth-child(n+6), .conversations > :nth-child(n+6) { animation-delay: .2s; }
/* Les pastilles rouges « rebondissent » à l'arrivée */
.pastille { animation: rebond .5s .3s cubic-bezier(.3, 1.6, .5, 1) both; }
/* Réaction au toucher */
.bouton, .tuile, a.chiffre, .onglet-icone, .bouton-icone, .avatar { transition: transform .12s ease, background .15s, border-color .15s, box-shadow .15s; }
.bouton:active, .tuile:active, a.chiffre:active, .bouton-icone:active, .avatar:active { transform: scale(.97); }
.onglets a:active .onglet-icone { transform: scale(.9); }
a.chiffre:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(23, 50, 77, .1); }
/* Les nouvelles bulles de discussion glissent depuis leur côté */
.fil > .bulle:last-of-type { animation: apparition .3s ease both; }

/* ---- Écrans vides illustrés ---- */
.vide-illustre { text-align: center; padding: 22px 12px 10px; }
.vide-dessin { position: relative; width: 132px; height: 112px; margin: 0 auto 10px; }
.vide-dessin .rond { position: absolute; border-radius: 46% 54% 52% 48% / 55% 45% 55% 45%; }
.vide-dessin .rond-1 { inset: 10px 14px 6px 10px; background: var(--bleu-clair); }
.vide-dessin .rond-2 { width: 54px; height: 54px; right: 0; top: 0; background: var(--bois-clair); border-radius: 50%; opacity: .9; }
.vide-dessin .point { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--bois); opacity: .55; }
.vide-dessin .p1 { left: 2px; top: 26px; } .vide-dessin .p2 { left: 22px; bottom: 0; width: 6px; height: 6px; background: var(--bleu); opacity: .35; }
.vide-dessin .p3 { right: 8px; bottom: 16px; width: 5px; height: 5px; }
.vide-icone {
  position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px;
  display: grid; place-items: center; border-radius: 18px; background: var(--carte); color: var(--bleu);
  box-shadow: 0 6px 18px rgba(23, 50, 77, .14); animation: flotter 4s ease-in-out infinite;
}
.vide-icone .ic { width: 30px; height: 30px; }
.vide-illustre.bois .vide-icone { color: var(--bois); }
.vide-illustre.vert .vide-icone { color: var(--vert); }
.vide-illustre.vert .rond-1 { background: var(--vert-fond); }
@media (prefers-color-scheme: dark) { .vide-icone { color: #8cc4ff; } }
.vide-titre { font-weight: 800; font-size: 1.05rem; margin: 4px 0 2px; }
.vide-texte { color: var(--discret); margin: 0 auto 6px; max-width: 34ch; font-size: .94rem; }
.vide-illustre .bouton { margin-top: 10px; }
.vide-illustre.compact { padding: 12px 8px 6px; }
.vide-illustre.compact .vide-dessin { width: 96px; height: 80px; transform: scale(.85); margin-bottom: 0; }

/* ---- Respect du réglage « réduire les animations » du téléphone ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
/* Icône au fil d'une phrase (sans casser la ligne) */
.ic.ic-texte { width: 18px; height: 18px; vertical-align: -3px; margin-right: 2px; }

/* ---- Double authentification ---- */
.etapes-securite { padding-left: 1.3em; }
.etapes-securite li { margin: 0 0 14px; }
.qr-code { width: 200px; max-width: 100%; margin: 12px 0; padding: 8px; background: #fff; border-radius: 12px; border: 1px solid var(--bord); }
.qr-code svg { display: block; width: 100%; height: auto; }
.champ-code { font: 700 1.5rem/1.2 ui-monospace, Menlo, monospace; letter-spacing: 4px; text-align: center; }
.codes-secours { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.codes-secours li { background: var(--fond); border: 1px dashed var(--bord-fort); border-radius: 10px; padding: 10px; text-align: center; font-size: 1.1rem; }
