/* Thème repris du site cabinetgameiro.fr : vert sauge #85a6a6, vert ardoise
   #2f4f4f / #163838, accent orange #fb8e28, polices DM Sans + Wix Madefor. */
@font-face { font-family: "DM Sans"; src: url("/static/dmsans.woff2") format("woff2"); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: "Wix Madefor Display"; src: url("/static/wixmadefor.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }

:root {
  --vert-fonce: #163838;
  --ardoise: #2f4f4f;
  --sauge: #85a6a6;
  --sauge-clair: #e5eded;
  --orange: #fb8e28;
  --fond: #f3f6f5;
  --bord: #d9e2e0;
  --encre: #22302e;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 "DM Sans", "Segoe UI", Arial, sans-serif; background: var(--fond); color: var(--encre); }
main { padding: 16px 20px 60px; }
h1, h2, h3, .marque { font-family: "Wix Madefor Display", "DM Sans", sans-serif; color: var(--vert-fonce); }
h1 { font-size: 23px; margin: 8px 0 14px; font-weight: 600; }
h2 { font-size: 16px; margin: 6px 0 10px; font-weight: 600; }
h3 { font-size: 14px; margin: 6px 0 8px; font-weight: 600; }
a { color: var(--ardoise); text-decoration: none; }
a:hover { color: var(--vert-fonce); text-decoration: underline; }

nav { display: flex; gap: 3px; align-items: center; background: var(--vert-fonce); color: #fff; padding: 7px 16px; position: sticky; top: 0; z-index: 30; box-shadow: 0 1px 6px rgba(0,0,0,.18); }
nav a, nav .menu { color: #e8f0ef; display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 7px; }
nav > a:hover, nav .menu:hover { background: rgba(255,255,255,.10); color: #fff; text-decoration: none; }
nav .marque { font-family: "Wix Madefor Display", sans-serif; font-weight: 600; letter-spacing: .3px; color: #fff; gap: 8px; margin-right: 6px; }
nav .marque .logo { height: 32px; width: auto; }
nav .marque { margin-right: 0; padding-right: 2px; }
nav .exercice-select { font-family: "Wix Madefor Display", sans-serif; font-weight: 600;
  font-size: 15px; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.25);
  border-radius: 7px; padding: 3px 6px; margin: 0 10px 0 0; cursor: pointer; }
nav .exercice-select:hover { background: rgba(255,255,255,.12); }
nav .exercice-select option { color: var(--vert-fonce); }
nav .droite { margin-left: auto; color: var(--sauge); gap: 8px; }
nav .droite a { padding: 5px; }
.ico { width: 16px; height: 16px; flex: none; }
nav .ico { opacity: .82; }
nav .menu .ico:last-child { opacity: .6; margin-left: -2px; }
nav .recherche { position: relative; display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.12); border-radius: 7px; padding: 0 8px; margin-left: 4px; }
nav .recherche .ico { color: #cfe0dc; }
nav .recherche input { padding: 6px 4px; border: 0; width: 190px; background: transparent; color: #fff; }
nav .recherche input::placeholder { color: #bcd2cd; }
nav .recherche input:focus { outline: none; }
.menu-recherche { position: absolute; top: 118%; left: 0; min-width: 260px; background: #fff; border: 1px solid var(--bord); border-radius: 8px; box-shadow: 0 8px 22px rgba(22,56,56,.20); z-index: 40; overflow: hidden; }
.menu-recherche:empty { display: none; }
.menu-recherche .res-item { display: block; padding: 8px 12px; color: var(--encre); border-bottom: 1px solid var(--fond); }
.menu-recherche a.res-item:hover { background: var(--sauge-clair); text-decoration: none; }
nav .menu { position: relative; cursor: pointer; }
nav .sous-menu { display: none; position: absolute; top: 100%; left: 0; background: #fff; border: 1px solid var(--bord); border-radius: 8px; padding: 6px 0; min-width: 185px; box-shadow: 0 8px 22px rgba(22, 56, 56, .20); }
nav .menu:hover .sous-menu { display: block; }
nav .sous-menu a { display: block; color: var(--encre); padding: 7px 16px; border-radius: 0; }
nav .sous-menu a:hover { background: var(--sauge-clair); color: var(--vert-fonce); }

#overlay-chargement { display: none; position: fixed; inset: 0; z-index: 200; background: rgba(22,56,56,.35); align-items: center; justify-content: center; gap: 14px; flex-direction: column; }
#overlay-chargement.actif { display: flex; }
#overlay-chargement .msg { color: #fff; font-weight: 500; }
#overlay-chargement .spinner { width: 42px; height: 42px; border: 4px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

.carte { background: #fff; border: 1px solid var(--bord); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.connexion { position: relative; max-width: 380px; margin: 7vh auto; border-top: 4px solid var(--sauge); text-align: center; padding: 26px 30px 30px; box-shadow: 0 10px 30px rgba(22,56,56,.10); }
.connexion .fermer-page { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; color: var(--sauge); font-size: 18px; line-height: 1; cursor: pointer; padding: 4px 7px; border-radius: 6px; }
.connexion .fermer-page:hover { background: var(--fond); color: var(--encre); }
.qr-box { display: flex; justify-content: center; margin: 12px 0; }
.qr-box svg { width: 210px; height: 210px; border: 1px solid var(--bord); border-radius: 8px; padding: 6px; background: #fff; }
.connexion code { background: var(--fond); padding: 3px 8px; border-radius: 5px; font-size: 13px; word-break: break-all; }
.connexion .logo-connexion { height: 130px; width: auto; margin-bottom: 2px; }
.connexion h1 { margin: 4px 0; }
.connexion form { text-align: left; margin-top: 14px; }
.connexion label { display: block; margin: 10px 0; font-size: 13px; color: var(--ardoise); }
.connexion input { width: 100%; padding: 9px; margin-top: 3px; }
.connexion button { width: 100%; padding: 10px; margin-top: 8px; font-size: 15px; }
.connexion .citation { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--bord); }
.connexion .citation blockquote { margin: 0; font-style: italic; color: var(--ardoise); font-size: 13.5px; line-height: 1.5; }
.connexion .citation figcaption { margin-top: 6px; font-size: 12px; color: #6d7b78; }
.erreur { color: #b3401f; }
.discret { color: #6d7b78; font-size: 12.5px; }
.note { background: #fdf3e3; border-left: 3px solid var(--orange); border-radius: 6px; padding: 8px; }
.badge { background: var(--sauge-clair); color: var(--vert-fonce); border-radius: 10px; padding: 2px 9px; font-size: 12px; display: inline-block; margin: 1px; }
.pastille { border-radius: 10px; padding: 2px 9px; font-size: 12px; display: inline-block; margin: 2px; border: 1px solid rgba(22, 56, 56, .10); }
.pastilles { line-height: 2; }
.alerte-retards h2 { color: #b3401f; }

.filtres { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.filtres select, .filtres input { padding: 5px 8px; }
button { background: var(--ardoise); color: #fff; border: 0; border-radius: 7px; padding: 6px 14px; cursor: pointer; font-family: inherit; }
button:hover { background: var(--vert-fonce); }
button.petit { padding: 3px 9px; font-size: 12px; }
.bouton { display: inline-block; background: var(--ardoise); color: #fff; border-radius: 7px; padding: 7px 14px; }
.bouton:hover { background: var(--vert-fonce); color: #fff; text-decoration: none; }
input, select { border: 1px solid var(--bord); border-radius: 6px; padding: 5px 8px; font: inherit; background: #fff; }
input:focus, select:focus { outline: 2px solid var(--sauge); border-color: var(--sauge); }

.defilement { overflow: auto; max-height: calc(100vh - 170px); background: #fff; border: 1px solid var(--bord); border-radius: 10px; }
table { border-collapse: collapse; }
.grille th, .grille td { border-right: 1px solid #edf2f0; border-bottom: 1px solid #edf2f0; padding: 4px 8px; font-size: 12.5px; white-space: nowrap; }
.grille thead th { background: var(--sauge-clair); color: var(--vert-fonce); position: sticky; top: 0; z-index: 10; border-bottom: 2px solid #c3d5d0; font-weight: 600; }
.grille th.fixe { position: sticky; left: 0; background: #f6f9f8; text-align: left; z-index: 5; max-width: 230px; overflow: hidden; text-overflow: ellipsis; box-shadow: 1px 0 0 #e2e9e7; }
.grille thead th.fixe { z-index: 20; top: 0; }
/* Zébrage + survol sur les cellules sans couleur de statut (cases vides, colonnes de tête) */
.grille tbody tr:nth-child(even) td:not([style]):not(.cel-grise):not(.cel-na),
.grille tbody tr:nth-child(even) th.fixe { background: #f5f8f7; }
.grille tbody tr:hover td:not([style]):not(.cel-grise):not(.cel-na),
.grille tbody tr:hover th.fixe { background: #e6f0ec; }
.grille th.ech, .grille th.dsn { font-size: 11px; }
.grille td.cel { min-width: 52px; cursor: pointer; }
.grille td.cel:hover { outline: 2px solid var(--sauge); outline-offset: -2px; }
.grille td.cel-active { outline: 3px solid var(--ardoise); outline-offset: -3px; }
.grille td.cel-active:focus { outline: 3px solid var(--ardoise); }
@keyframes flash-vert { 0% { background: #7ed49a; } 100% { } }
.grille td.flash-saved { animation: flash-vert 0.9s ease-out; }
.grille tfoot .totaux th, .grille tfoot .totaux td { background: #eef1f5; border-top: 2px solid var(--sauge); font-size: 13px; position: sticky; bottom: 0; }
.grille td.cel-grise { min-width: 52px; cursor: not-allowed;
  background: repeating-linear-gradient(45deg, #d8dcd9, #d8dcd9 4px, #cfd4d1 4px, #cfd4d1 8px); }
/* Cellule au statut « Non applicable » (N/A saisi) : même hachuré, mais modifiable. */
.grille td.cel-na { background: repeating-linear-gradient(45deg, #d8dcd9, #d8dcd9 4px, #cfd4d1 4px, #cfd4d1 8px); }
/* Client à mission suspendue : cellules non saisissables (grisées, curseur bloqué). */
.grille td.cel-suspendu { cursor: not-allowed; opacity: .55; }
.grille td.cel-suspendu:hover { outline: none; }
.grille tr.ligne-suspendue th.fixe { color: #8a8f8d; }
.badge-susp { font-size: 10.5px; font-weight: 600; color: #8f3016; background: #f6e0d7; border-radius: 4px; padding: 0 5px; margin-left: 4px; white-space: nowrap; }
.ok-flash { color: var(--vert-fonce); font-weight: 600; font-size: 13px; animation: flash-vert 1.2s ease-out; }
.outils-grille { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.outils-grille .outil-champ { font-size: 12px; color: var(--ardoise); }
.grille td.param, .grille td.equipe { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
td.edition { background: #fff; min-width: 300px; }
td.edition form { display: flex; gap: 4px; align-items: center; }
td.edition .saisie { width: 130px; }
td.edition .comm { width: 130px; }
.puce-comm { color: var(--ardoise); font-size: 8px; vertical-align: super; margin-left: 2px; }

.liste td, .liste th { padding: 3px 9px; text-align: left; font-size: 13px; }
.liste.large { width: 100%; }
.liste tr:nth-child(even) { background: #f5f8f7; }
.fiche th { text-align: left; padding: 3px 12px 3px 0; color: #6d7b78; font-weight: 500; vertical-align: top; }
.formulaire label { display: block; margin: 7px 0; }
.formulaire input { width: 320px; }
.formulaire fieldset { border: 1px solid var(--bord); border-radius: 8px; margin: 10px 0; }
.ligne { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.compacte td { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }

/* Filtres dans les en-têtes de colonnes de rôle (vue mission) */
.grille th.role-col { vertical-align: top; }
.filtre-col { font-size: 11px; padding: 1px 3px; margin-top: 3px; max-width: 92px; font-weight: 400; }

/* Cases à cocher d'affectation (fiche client) */
.affect-form .roles { border: 1px solid var(--bord); border-radius: 8px; margin: 8px 0; padding: 6px 10px 8px; }
.affect-form legend { font-weight: 500; color: var(--vert-fonce); padding: 0 4px; }
.affect-form .case { display: inline-flex; align-items: center; gap: 4px; margin: 2px 10px 2px 0; font-weight: 400; white-space: nowrap; }
.affect-form .case input { width: auto; }

.lien-danger { color: #b3401f; }
button.danger, .bouton.danger { background: #b3401f; }
button.danger:hover, .bouton.danger:hover { background: #8f3016; }
.zone-danger { border: 1px solid #ecc7bd; background: #fdf3ef; }
.zone-danger h2 { color: #b3401f; }

.legende { margin: 0 0 12px; font-size: 12.5px; }
.legende summary { cursor: pointer; color: var(--ardoise); }
.legende .lg { display: inline-flex; align-items: center; gap: 5px; margin: 6px 14px 0 0; }
.pastille-couleur { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(22,56,56,.15); }
.pastille-couleur.hachure { background: repeating-linear-gradient(45deg, #d8dcd9, #d8dcd9 3px, #cfd4d1 3px, #cfd4d1 6px); }

.pastille.p-g { background: #d1f2d9; }
.pastille.p-a { background: #faf3c0; }
.pastille.p-r { background: #f8d2d2; }
.pastille.p-b { background: #d6e6f7; }

/* Avancement du mois : barres de progression par mission */
.avancement h2 { margin-bottom: 8px; }
.avance-ligne { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; align-items: center; margin: 7px 0; }
.avance-nom { font-size: 13px; font-weight: 600; color: var(--ardoise); }
.barre { height: 12px; background: #edf1f0; border-radius: 7px; overflow: hidden; }
.barre-remplie { display: block; height: 100%; background: var(--sauge); border-radius: 7px; transition: width .3s; }
.barre-remplie.pleine { background: #7ac695; }
.avance-chiffres { font-size: 12.5px; color: var(--ardoise); white-space: nowrap; }
.avance-chiffres .pastille { font-size: 11.5px; padding: 1px 8px; margin-left: 6px; }

/* Urgence des échéances (Ma semaine) */
.urg { display: inline-block; padding: 1px 7px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.urg-rouge { background: #f8d2d2; color: #8f2f16; font-weight: 600; }
.urg-orange { background: #fde2c8; color: #8a4a12; font-weight: 600; }

/* Pilotage — cellule d'avancement par salarié */
.pilotage td { vertical-align: middle; }
.pilo-cell { display: flex; align-items: center; gap: 7px; }
.pilo-cell .barre { width: 60px; flex: none; }
.pilo-chiffre { font-weight: 600; font-size: 12.5px; }
.pilo-chiffre.pilo-ok { color: #2f7d4f; }
.pilo-chiffre.pilo-moy { color: var(--ardoise); }
.pilo-chiffre.pilo-bas { color: #b3401f; }

/* En attente (relances) */
.pastille.attente-client { background: #fde2c8; }
.pastille.attente-banque { background: #faf3c0; }
.pastille.attente-interne { background: #e8dcf5; }
.synthese { display: flex; gap: 10px; align-items: center; margin: 4px 0 14px; }
.synthese .pastille { font-size: 14px; padding: 5px 12px; }
a.pastille:hover { text-decoration: none; opacity: .9; }

/* --- Module gestion des temps --- */
.barre-jour { flex-wrap: wrap; }
.barre-jour input[type=date] { padding: 5px 8px; }
.bouton.petit { padding: 4px 10px; font-size: 12px; }

/* Vue semaine : colonnes jour */
.temps-semaine td.cel-jour { vertical-align: top; min-width: 132px; white-space: normal; padding: 6px; }
.temps-semaine th.col-aujourdhui { background: #d6e6f7; }
.temps-chip { display: block; background: var(--sauge-clair); border: 1px solid var(--bord);
  border-radius: 6px; padding: 3px 6px; margin-bottom: 4px; font-size: 12px; line-height: 1.25; }
.temps-chip:hover { background: #d6e6f7; text-decoration: none; }
.temps-chip strong { color: var(--vert-fonce); margin-right: 4px; }
.temps-chip span { color: var(--ardoise); }

/* Vue jour : tableau et formulaire */
.temps-jour td { vertical-align: middle; }
.temps-jour .boutons { white-space: nowrap; }
.msg-erreur { background: #f8d2d2; font-size: 13.5px; padding: 6px 12px; }
.form-temps .form-temps-lignes { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.form-temps label { display: block; margin: 7px 0; font-size: 13px; }
.form-temps label.case { display: inline-flex; align-items: center; gap: 6px; }
.form-temps input[type=number] { width: 90px; }
.form-temps fieldset.rattachement { border: 1px solid var(--bord); border-radius: 8px; margin: 10px 0; padding: 8px 12px; }
.form-temps fieldset.rattachement legend { font-size: 12px; color: var(--ardoise); padding: 0 4px; }
.form-temps fieldset .opt { display: flex; align-items: center; gap: 8px; margin: 5px 0; flex-wrap: wrap; }
.form-temps fieldset .opt input[type=radio] { width: auto; }
.form-temps .ch-comm input { width: 420px; max-width: 100%; }
.form-temps .boutons { display: inline-flex; gap: 8px; margin-top: 8px; }

/* Commentaire obligatoire (type « Social ») */
.form-temps .ch-comm .req-note { display: none; color: #b3401f; font-weight: 600; }
.form-temps .ch-comm.requis .opt-note { display: none; }
.form-temps .ch-comm.requis .req-note { display: inline; }
.form-temps input.champ-requis { border-color: #b3401f; box-shadow: 0 0 0 2px rgba(179,64,31,.15); }

/* Vue mois : calendrier */
.temps-mois { table-layout: fixed; width: 100%; }
.temps-mois thead th { text-align: left; }
.temps-mois td.cell-mois { vertical-align: top; height: 82px; width: 14.28%; padding: 4px 5px; white-space: normal; }
.temps-mois td.hors-mois { background: #f3f6f5; }
.temps-mois td.col-aujourdhui { outline: 2px solid var(--sauge); outline-offset: -2px; }
.temps-mois .cell-mois-lien { display: flex; justify-content: space-between; align-items: baseline; }
.temps-mois .cell-mois-lien:hover { text-decoration: none; }
.temps-mois .num-jour { font-weight: 600; color: var(--vert-fonce); }
.temps-mois .total-jour { font-size: 11px; color: var(--ardoise); font-weight: 600; }
.temps-chip.mini { font-size: 10.5px; padding: 1px 4px; margin: 2px 0 0; }

/* Reporting */
.rapport td.num, .rapport th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rapport tfoot .totaux th, .rapport tfoot .totaux td { border-top: 2px solid var(--sauge); font-weight: 600; }
.rapport-filtres label { margin-right: 12px; }
