:root {
  --marque: #1F3B4D;
  --marque-2: #33576C;
  --accent: #E8732E;
  --fond: #F5F6F7;
  --carte: #FFFFFF;
  --texte: #17212B;
  --doux: #4A5763;
  --bord: #DDE2E7;
  --bord-champ: #C5CCD3;
  --ok-fond: #D5EFEA; --ok-texte: #0B5A52; --ok-plein: #1E7F74;
  --att-fond: #FCEBC7; --att-texte: #7A4A00; --att-plein: #F2C66D;
  --non-fond: #FBE2DF; --non-texte: #8C1D13; --non-plein: #B42318;
  --info-fond: #EAF2FA; --info-texte: #123A5E;
  --ecole: #6D4FB0;
  --rayon: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-family: "Space Grotesk", Inter, system-ui, sans-serif; font-weight: 600; font-size: 28px; }
h2 { font-size: 17px; font-weight: 600; }
a { color: #1F4E79; }
a:hover { color: #163A5A; }
:focus-visible { outline: 3px solid #5B9BD5; outline-offset: 2px; }
p { margin: 0; }
.doux { color: var(--doux); }
.petit { font-size: 13px; }
.cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* en-tête */
.entete { background: var(--marque); color: #fff; padding: 0 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 28px; min-height: 60px; }
.entete .nom-app { font-family: "Space Grotesk", Inter, sans-serif; font-weight: 600; font-size: 18px; color: #fff; text-decoration: none; }
.entete nav { display: flex; flex-wrap: wrap; gap: 2px; }
.entete nav a { padding: 9px 12px; border-radius: 8px; color: #E3EBF0; text-decoration: none; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.entete nav a.actif { background: var(--marque-2); color: #fff; font-weight: 600; }
.entete .qui { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 14px; color: #E3EBF0; }
.entete .qui button { background: none; border: 1px solid #5A7688; color: #E3EBF0; border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.pastille { background: var(--accent); color: #1A0F06; border-radius: 10px; padding: 1px 8px; font-size: 12px; font-weight: 700; }

main { padding: 24px; max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
main.large { max-width: 1480px; }
main.etroit { max-width: 760px; }
.titre { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; }
.titre > div:first-child { flex: 1 1 380px; display: flex; flex-direction: column; gap: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* éléments */
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 14px; padding: 18px 20px; }
.bandeau { border-radius: var(--rayon); padding: 12px 16px; font-size: 14px; }
.bandeau.info { background: var(--info-fond); color: var(--info-texte); }
.bandeau.att { background: #FFF6E5; border: 1px solid #F0D49A; color: #3D2600; }
.bandeau.ok { background: #E7F5F2; border: 1px solid #9FD3C9; color: #0B4A44; }
.bandeau.err { background: var(--non-fond); color: var(--non-texte); }
.flash { background: #E7F5F2; border: 1px solid #9FD3C9; color: #0B4A44; border-radius: var(--rayon); padding: 12px 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; background: var(--marque); color: #fff; }
.btn:hover { color: #fff; filter: brightness(1.08); }
.btn.second { background: #fff; color: var(--marque); border-color: var(--marque); }
.btn.second:hover { color: var(--marque); background: #F2F5F8; }
.btn.accent { background: var(--accent); color: #1A0F06; }
.btn.vert { background: var(--ok-plein); }
.btn.rouge { background: #fff; color: var(--non-texte); border-color: var(--non-plein); }
.btn.danger { background: var(--non-plein); }
.btn.petit { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.plein { width: 100%; }
.btn:disabled { background: #D9DEE3; color: #3A4550; border-color: #D9DEE3; cursor: not-allowed; }

.statut { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.statut.ok { background: var(--ok-fond); color: var(--ok-texte); }
.statut.att { background: var(--att-fond); color: var(--att-texte); }
.statut.non { background: var(--non-fond); color: var(--non-texte); }
.statut.gris { background: #E6E9EC; color: #3A4550; }
.statut.bleu { background: var(--info-fond); color: var(--info-texte); }

label { font-size: 14px; font-weight: 600; }
.champ { display: flex; flex-direction: column; gap: 6px; }
input[type=text], input[type=password], input[type=date], input[type=email], input[type=number], select, textarea {
  min-height: 44px; border: 1px solid var(--bord-champ); border-radius: 10px; padding: 0 12px; font: inherit; color: var(--texte); background: #fff; width: 100%;
}
textarea { padding: 10px 12px; resize: vertical; }
.grille { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puces input { position: absolute; opacity: 0; }
.puces label { min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--bord-champ); background: #fff; display: inline-flex; align-items: center; cursor: pointer; font-weight: 600; }
.puces input:checked + label { background: var(--marque); color: #fff; border-color: var(--marque); }
.puces input:focus-visible + label { outline: 3px solid #5B9BD5; outline-offset: 2px; }

.tableau { background: #fff; border: 1px solid var(--bord); border-radius: 14px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--doux); font-size: 13px; font-weight: 600; padding: 11px 12px; border-bottom: 1px solid var(--bord); background: #fff; }
td { padding: 10px 12px; border-bottom: 1px solid #EEF1F4; vertical-align: top; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.total td { font-weight: 700; background: var(--fond); }
tr.groupe td { background: #EEF3F7; font-weight: 700; }

.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.chiffre { background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon); padding: 14px 16px; }
.chiffre .v { font-size: 24px; font-weight: 600; margin-top: 4px; }
.chiffre.ok { background: #E7F5F2; border-color: #9FD3C9; color: #0B4A44; }
.chiffre.att { background: #FFF6E5; border-color: #F0D49A; color: #3D2600; }

/* espace salarié */
.solde { background: var(--marque); color: #fff; border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.solde .gros { font-family: "Space Grotesk", Inter, sans-serif; font-size: 44px; font-weight: 600; line-height: 1; }
.solde .doux { color: #D3DEE6; }
.resume { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.resume div { background: #fff; border: 1px solid var(--bord); border-radius: 10px; padding: 10px 6px; text-align: center; }
.resume b { display: block; font-size: 18px; }
.resume span { font-size: 12px; color: var(--doux); line-height: 1.3; display: block; }
.demande { background: #fff; border: 1px solid var(--bord); border-radius: 12px; padding: 12px; display: flex; gap: 12px; align-items: flex-start; }
.demande .bloc { width: 52px; flex: none; border-radius: 10px; text-align: center; padding: 6px 0; display: flex; flex-direction: column; background: #E6E9EC; color: #3A4550; }
.demande .bloc b { font-size: 20px; line-height: 1.1; }
.demande .bloc span { font-size: 11px; font-weight: 600; text-transform: uppercase; }
.demande .bloc.ok { background: var(--ok-plein); color: #fff; }
.demande .bloc.att { background: var(--att-fond); color: #5C3800; }
.demande .bloc.non { background: var(--non-fond); color: var(--non-texte); }
.demande .corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.demande .ligne1 { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-weight: 600; }
.note { font-size: 13px; border-radius: 8px; padding: 6px 9px; background: var(--info-fond); color: var(--info-texte); }
.note.non { background: #FBE7E4; color: var(--non-texte); }
.section-titre { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.compte { font-size: 12px; font-weight: 600; color: var(--doux); background: #E6E9EC; border-radius: 10px; padding: 1px 8px; }

/* planning et clôture */
.calendrier { background: #fff; border: 1px solid var(--bord); border-radius: 14px; overflow-x: auto; }
.calendrier table { border-collapse: separate; border-spacing: 2px; font-size: 12px; min-width: 100%; }
.calendrier th, .calendrier td { padding: 0; border: 0; text-align: center; }
.calendrier th.jour { font-size: 11px; color: var(--doux); font-weight: 600; min-width: 28px; padding: 2px 0; border-radius: 4px; }
.calendrier th.jour b { display: block; color: var(--texte); font-size: 12px; }
.calendrier th.jour.auj { background: var(--info-fond); }
.calendrier .nom { position: sticky; left: 0; background: #fff; z-index: 1; text-align: left; padding: 2px 10px 2px 8px; white-space: nowrap; font-size: 13px; min-width: 150px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.calendrier .nom small { display: block; font-size: 11px; }
.calendrier tr.grp td { text-align: left; padding: 12px 8px 4px; font-size: 13px; font-weight: 700; position: sticky; left: 0; }
.c { height: 28px; min-width: 28px; border-radius: 4px; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 1px solid transparent; }
button.c { width: 100%; cursor: pointer; font: inherit; font-size: 10px; font-weight: 700; padding: 0; }
.c.travail { background: #E3EEF8; color: var(--info-texte); }
.c.demi { background: #F2F7FC; color: var(--info-texte); }
.c.repos { background: #D9DEE3; color: #3A4550; }
.c.ferme { background: #F1F3F5; }
.c.conge { background: var(--ok-plein); color: #fff; }
.c.demande { background: var(--att-plein); color: #3D2600; }
.c.absent { background: #6B7682; color: #fff; }
.c.ecole { background: var(--ecole); color: #fff; }
.c.renfort { background: #8FB8DE; color: #0E2E4A; }
.c.ajuste { border: 2px solid var(--accent); }
.legende { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: var(--doux); align-items: center; }
.legende span.c { display: inline-flex; min-width: 22px; height: 18px; margin-right: 6px; vertical-align: middle; }
.moi .nom { font-weight: 700; }
.calendrier td.tot { font-size: 14px; font-weight: 700; min-width: 64px; padding: 0 6px; }

/* outils divers */
.semaine-type { display: grid; grid-template-columns: 110px repeat(7, minmax(64px, 1fr)) 110px; gap: 6px; align-items: center; min-width: 720px; }
.semaine-type button.c { height: 50px; font-size: 13px; }
.annee-ecole { display: grid; grid-template-columns: 120px repeat(5, minmax(0, 1fr)); gap: 6px; align-items: center; }
.annee-ecole label.sem { min-height: 34px; border-radius: 8px; border: 1px solid #B9D2EA; background: #E3EEF8; color: var(--info-texte); display: flex; align-items: center; justify-content: center; font-size: 12px; cursor: pointer; }
.annee-ecole input:checked + label.sem { background: var(--ecole); border-color: var(--ecole); color: #fff; }
.annee-ecole input { position: absolute; opacity: 0; }
.acces-cree { background: #E7F5F2; border: 1px solid #9FD3C9; border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }
details summary { cursor: pointer; font-weight: 600; }

/* connexion */
.connexion { max-width: 400px; margin: 0 auto; padding: 64px 24px 32px; display: flex; flex-direction: column; gap: 28px; }
.logo { width: 52px; height: 52px; border-radius: 14px; background: var(--marque); display: flex; align-items: center; justify-content: center; }

@media (max-width: 640px) {
  main { padding: 16px; }
  .entete { padding: 8px 12px; }
  .entete .qui { margin-left: 0; }
  h1 { font-size: 24px; }
  .resume { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
  .entete, .actions, .ne-pas-imprimer, form { display: none !important; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  .tableau, .carte { border: 0; }
}
[hidden] { display: none !important; }
