/* Structure des écrans, reprise de la maquette. Les couleurs et la police
   viennent de theme.css. */
:root {
	--ombre: 0 1px 3px rgba(10, 10, 10, .05), 0 8px 24px -16px rgba(10, 10, 10, .25);
	--r: 8px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
	margin: 0;
	font: 14px/1.55 var(--police);
	color: var(--encre);
	background: var(--fond);
	-webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--bleu); }
.mono { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ====== logo ====== */
.logo { display: flex; align-items: center; gap: 9px; }
.logoMarque {
	width: 36px; height: 36px; flex: 0 0 36px;
	border-radius: var(--r); background: #fff;
	display: flex; align-items: center; justify-content: center;
}
.logoMarque span { font-weight: 700; font-size: 15px; color: var(--bleu); letter-spacing: -.04em; }
.logoTexte .n { display: block; font-weight: 600; font-size: 17px; letter-spacing: -.01em; line-height: 1.15; }
.logoTexte .s { display: block; font-size: 10.5px; font-weight: 400; opacity: .72; line-height: 1.2; }

/* ====== connexion ====== */
.vueConnexion {
	min-height: 100%;
	display: flex; align-items: center; justify-content: center;
	padding: 36px 18px;
	background: linear-gradient(135deg, var(--bleu-f) 0%, var(--bleu) 62%, var(--bleu-vif) 100%);
}
.carte {
	width: 100%; max-width: 450px;
	background: var(--panneau); border-radius: 14px;
	box-shadow: 0 24px 60px -24px rgba(0, 40, 55, .55);
	padding: 34px 34px 26px;
}
@media (max-width: 520px) {
	.vueConnexion { padding: 16px 12px; align-items: flex-start; }
	.carte { padding: 22px 20px 18px; border-radius: 12px; }
}
.carte .logo { margin-bottom: 6px; }
.carte .logoMarque { background: var(--bleu-s); }
.slogan { color: var(--encre2); font-size: 13px; margin: 0 0 26px; }
label { display: block; font-size: 12.5px; font-weight: 500; color: var(--encre2); margin-bottom: 5px; }
.champ {
	width: 100%; padding: 11px 13px; margin-bottom: 15px;
	border: 1px solid var(--ligne); border-radius: var(--r);
	background: #FCFCFC; font-size: 14px;
}
.champ:focus { border-color: var(--bleu); background: #fff; outline: none; box-shadow: 0 0 0 3px var(--bleu-s); }
.btn {
	width: 100%; padding: 12px; border: 0; border-radius: var(--r);
	background: var(--bleu); color: #fff; font-weight: 500; font-size: 14.5px;
	transition: background .15s;
}
.btn:hover { background: var(--bleu-f); }
.message { margin: 0 0 16px; font-size: 12.5px; padding: 9px 12px; border-radius: var(--r); }
.message.erreur { color: var(--corail); background: var(--corail-s); }
.message.info { color: var(--ambre-t); background: var(--ambre-s); }
.message.succes { color: var(--vert); background: var(--vert-s); }
.pied { margin-top: 18px; font-size: 11.5px; line-height: 1.5; color: var(--encre3); }
a.btn { display: block; text-align: center; text-decoration: none; }

/* ====== double authentification ====== */
.champ.code { font-size: 20px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.etapes { margin: 0 0 12px; padding-left: 20px; font-size: 13px; color: var(--encre2); }
.etapes li { margin-bottom: 6px; }
.qr { width: 184px; margin: 4px auto 12px; padding: 8px; border: 1px solid var(--ligne); border-radius: var(--r); background: #fff; }
.qr svg { display: block; width: 100%; height: auto; }
.cleManuelle { margin: 0 0 16px; font-size: 12.5px; color: var(--encre2); }
.cleManuelle summary { cursor: pointer; }
.cleManuelle code {
	display: block; margin-top: 8px; padding: 9px 12px; border-radius: var(--r);
	background: var(--bleu-s); color: var(--bleu-f); font-size: 13.5px; letter-spacing: .06em; word-break: break-all;
}
.codesSecours {
	list-style: none; margin: 0 0 16px; padding: 12px; border-radius: var(--r); background: var(--fond);
	display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px;
	font: 600 14px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: center;
}
.abandon { margin: 10px 0 0; text-align: center; }
.lien { background: none; border: 0; padding: 0; color: var(--bleu); font-size: 12.5px; text-decoration: underline; }

/* ====== application ====== */
.bandeau {
	background: linear-gradient(110deg, var(--bleu-f) 0%, var(--bleu) 100%);
	color: #fff; padding: 13px 22px;
	display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.bandeau .logoMarque { width: 34px; height: 34px; flex-basis: 34px; }
.moi { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.jeton {
	width: 33px; height: 33px; flex: 0 0 33px; border-radius: 50%;
	background: rgba(255, 255, 255, .17); color: #fff;
	display: flex; align-items: center; justify-content: center;
	font-weight: 600; font-size: 11.5px;
}
.moiN { font-weight: 500; font-size: 13px; line-height: 1.25; }
.moiR { font-size: 11.5px; opacity: .75; line-height: 1.25; }
.moi .btn {
	width: auto; padding: 7px 13px; font-size: 12.5px;
	background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .28);
}
.moi .btn:hover { background: rgba(255, 255, 255, .26); }
.moi form { margin: 0; }

nav.onglets {
	background: var(--panneau); border-bottom: 1px solid var(--ligne);
	padding: 0 22px; display: flex; gap: 2px; overflow-x: auto;
}
nav.onglets a {
	padding: 12px 15px; font-size: 13.5px; font-weight: 500; color: var(--encre2);
	text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap;
}
nav.onglets a:hover { color: var(--bleu); }
nav.onglets .version { margin-left: auto; align-self: center; font-size: 11.5px; color: var(--encre3); white-space: nowrap; }
nav.onglets a[aria-current="page"] { color: var(--bleu); border-bottom-color: var(--bleu); font-weight: 600; }

main { padding: 20px 22px 64px; max-width: 1500px; margin: 0 auto; }

/* bandeau de périmètre */
.portee {
	background: var(--bleu-f); color: #fff; border-radius: var(--r);
	padding: 18px 22px; margin-bottom: 18px;
	display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
}
.porteeN { font-size: 38px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.porteeN span { font-size: 20px; opacity: .55; font-weight: 400; }
.porteeT { flex: 1; min-width: 230px; }
.porteeT b { display: block; font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.porteeT i { font-style: normal; font-size: 13px; color: rgba(255, 255, 255, .76); line-height: 1.5; }

/* pastilles de statut */
.pill {
	display: inline-block; border: 1px solid var(--ligne); border-radius: 99px;
	padding: 3px 9px; font-size: 11px; font-weight: 600; background: #fff; min-width: 62px;
}
.pill.A_FAIRE { color: var(--encre2); }
.pill.EN_COURS { background: var(--ambre-s); color: var(--ambre-t); border-color: transparent; }
.pill.FAIT { background: var(--vert-s); color: var(--vert); border-color: transparent; }
.pill.NA { color: var(--encre3); background: #F4F4F4; border-color: transparent; }
.pill.retard { border-color: var(--corail); color: var(--corail); background: var(--corail-s); }
.sansObjet { color: var(--encre3); }
/* Statut modifiable : la même pastille, en liste déroulante. */
.formStatut { margin: 0; }
select.pill {
	appearance: none; -webkit-appearance: none; cursor: pointer;
	text-align: center; text-align-last: center; line-height: 1.4;
}
select.pill:hover { box-shadow: 0 0 0 2px var(--bleu-s); }
.formStatut.htmx-request select.pill { opacity: .5; cursor: progress; }

/* grille */
.barreInfo {
	display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
	margin-bottom: 11px; font-size: 12.5px; color: var(--encre2);
}
.resumeRetards { margin: 0; }
.actualisation { font-size: 11.5px; color: var(--encre3); }
.navAnnee {
	display: flex; align-items: center; gap: 2px; margin-left: auto;
	background: var(--panneau); border: 1px solid var(--ligne); border-radius: 22px; padding: 3px;
}
.navAnnee a, .navAnnee span.inactif {
	width: 28px; height: 28px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	text-decoration: none; color: var(--encre2); font-size: 15px;
}
.navAnnee a:hover { background: var(--bleu-s); color: var(--bleu); }
.navAnnee span.inactif { color: var(--ligne); }
.navAnnee b { min-width: 56px; text-align: center; font-weight: 600; color: var(--encre); font-variant-numeric: tabular-nums; }

.cadreTable {
	overflow: auto; max-height: 66vh;
	border: 1px solid var(--ligne); border-radius: var(--r); background: var(--panneau);
}
table.grille { border-collapse: separate; border-spacing: 0; font-size: 12px; white-space: nowrap; }
table.grille th, table.grille td {
	border-right: 1px solid var(--ligne); border-bottom: 1px solid var(--ligne); padding: 6px 8px;
}
table.grille thead th { position: sticky; background: #fff; z-index: 3; font-weight: 600; text-align: center; }
table.grille thead tr:first-child th {
	top: 0; color: #fff; font-size: 10.5px; letter-spacing: .05em; z-index: 4; padding: 5px 8px;
}
table.grille thead tr:nth-child(2) th { top: 26px; color: var(--encre2); font-size: 10.5px; background: #FAFAFA; }
table.grille td { text-align: center; }
table.grille td.gauche, table.grille th.gauche { text-align: left; }
.grp-client { background: var(--bleu-f) !important; }
.grp-equipe { background: var(--bleu) !important; }
.grp-tva { background: var(--bleu-vif) !important; }
.grp-pilotage { background: var(--corail) !important; }
/* Largeur fixe : .colNom est collée à exactement cette distance du bord. */
.colCode {
	width: 52px; min-width: 52px; max-width: 52px;
	position: sticky; left: 0; background: #fff; z-index: 2;
	font-variant-numeric: tabular-nums; color: var(--encre3); font-size: 11px;
}
.colNom { position: sticky; left: 52px; background: #fff; z-index: 2; font-weight: 500; min-width: 180px; }
/* Assez spécifique pour l'emporter sur les règles de l'en-tête : sinon les
   colonnes de mois passent par-dessus au défilement horizontal. */
table.grille thead tr th.colCode, table.grille thead tr th.colNom { z-index: 5; }
table.grille tbody tr:hover td { background: #FBFBFB; }
table.grille tbody tr:hover .colCode, table.grille tbody tr:hover .colNom { background: #F5F9FB; }
.sante { border-radius: 99px; padding: 2px 9px; font-size: 10px; font-weight: 600; }
.sante.AJOUR { background: var(--vert-s); color: var(--vert); }
.sante.RETARD { background: var(--corail); color: #fff; }
.retards { color: var(--corail); font-weight: 600; }
.vide { padding: 28px 20px; text-align: center; color: var(--encre3); font-size: 13.5px; }
.aide { font-size: 12px; color: var(--encre3); margin-top: 11px; }

/* pages d'erreur */
.erreurPage { max-width: 40rem; margin: 18vh auto 0; padding: 0 1rem; }
.erreurPage h1 { color: var(--bleu); font-weight: 600; }

@media (max-width: 720px) {
	main { padding: 16px 14px 52px; }
	.bandeau { padding: 11px 14px; gap: 12px; }
	nav.onglets { padding: 0 14px; }
	.porteeN { font-size: 31px; }
}

/* ====== administration ====== */
main.admin { max-width: 960px; }
main.admin h1 { font-size: 22px; font-weight: 600; margin: 0; }
main.admin h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
main.admin h3 { font-size: 13.5px; font-weight: 600; margin: 18px 0 6px; color: var(--encre2); }
main.admin h2 + p.aide + h3, main.admin h2 + h3 { margin-top: 0; }
.titreAdmin { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.titreAdmin .btn { margin-left: auto; }
.filAriane { font-size: 12.5px; color: var(--encre3); margin: 0 0 6px; }
.panneauAdmin {
	background: var(--panneau); border: 1px solid var(--ligne); border-radius: var(--r);
	padding: 18px 20px; margin-bottom: 14px; font-size: 13.5px;
}
.panneauAdmin p { margin: 0 0 12px; }
.btn.compact { width: auto; padding: 8px 14px; font-size: 13px; }
a.btn.compact { display: inline-block; }
.btn.secondaire { background: var(--panneau); color: var(--bleu); border: 1px solid var(--bleu); }
.btn.secondaire:hover { background: var(--bleu-s); }
.btn.danger { background: var(--corail); }
.btn.danger:hover { background: #C94F3E; }
.boutons { display: flex; flex-wrap: wrap; gap: 8px; }
.confirmation { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin-top: 4px; }
.confirmation label { flex-basis: 100%; margin-bottom: -6px; }
.confirmation .champ.code { width: 150px; margin: 0; padding: 7px 10px; font-size: 16px; }
.grilleChamps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.grilleChamps .large { grid-column: span 3; }
.grilleChamps .double { grid-column: span 2; }
.facultatif { font-weight: 400; color: var(--encre3); font-size: 11.5px; margin-left: 4px; }
.etiquette { display: block; font-size: 12.5px; font-weight: 500; color: var(--encre2); margin-bottom: 5px; }
.cloture { display: flex; gap: 8px; }
.cloture input { width: 5em; flex: none; }
dl.fiche { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 13.5px; }
dl.fiche dt { color: var(--encre2); }
dl.fiche dd { margin: 0; }
@media (max-width: 720px) {
	.grilleChamps { grid-template-columns: 1fr; }
	.grilleChamps .large, .grilleChamps .double { grid-column: auto; }
}
.caseACocher { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 0 0 14px; color: var(--encre); }
.consignes { margin: 0 0 14px; padding-left: 20px; color: var(--encre2); }
.consignes li { margin-bottom: 6px; }
.lienAcces { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.lienEnAttente { color: var(--ambre-t); }
.zoneDepart { border-color: var(--corail-s); }
.zoneDepart h2 { color: var(--corail); }
table.liste { width: 100%; border-collapse: collapse; font-size: 13px; }
table.liste th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--encre2); background: #FAFAFA; }
table.liste th, table.liste td { padding: 9px 12px; border-bottom: 1px solid var(--ligne); }
table.liste tr.parti td { color: var(--encre3); }
.badge { display: inline-block; border-radius: 99px; padding: 2px 9px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge.ACTIF { background: var(--vert-s); color: var(--vert); }
.badge.EN_ATTENTE { background: var(--ambre-s); color: var(--ambre-t); }
.badge.LIEN_EXPIRE, .badge.VERROUILLE { background: var(--corail-s); color: var(--corail); }
.badge.PARTI { background: #F0F0F0; color: var(--encre3); }
.badge.admin { background: var(--bleu-s); color: var(--bleu); margin-left: 6px; }

/* ====== répartition ====== */
main.admin.large { max-width: 1200px; }
.filtres { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 18px; margin-bottom: 4px; }
.filtres .champ { min-width: 260px; margin-bottom: 10px; }
.filtres .caseACocher { margin-bottom: 20px; }
.manque { color: var(--corail); font-weight: 500; }
span.parti { color: var(--encre3); text-decoration: line-through; }
table.liste tr.aReaffecter td:first-child { box-shadow: inset 3px 0 0 var(--corail); }
.panneauAdmin.role p { margin-bottom: 10px; }
.affecter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.affecter .champ, .transfert .champ { margin: 0; padding: 7px 10px; min-width: 260px; width: auto; }
.transfert { align-items: center; margin-top: 14px; }
.transfert label { margin: 0; }
.masque { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
