/* Planning des équipes — ELIF · SOCADEM — v2.0 */
@font-face { font-family: 'Open Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/open-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Open Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url('fonts/open-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Open Sans'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/open-sans-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Open Sans'; font-weight: 800; font-style: normal; font-display: swap; src: url('fonts/open-sans-latin-800-normal.woff2') format('woff2'); }

:root {
  --vert: #00AB4E;          /* Pantone 354C - décor */
  --vert-action: #007A38;   /* boutons (contraste AA sur blanc) */
  --vert-action-fonce: #005C2A;
  --vert-texte: #0B6B35;
  --vert-doux: #E6F4EC;
  --encre: #0E1B14;
  --encre-2: #3E4F46;
  --encre-3: #5E6E66;
  --encre-4: #6B7B73;
  --ligne: #E4EAE6;
  --ligne-2: #EEF1EE;
  --ligne-3: #F0F2F0;
  --champ: #CFD8D2;
  --fond: #F7F6F2;
  --blanc: #FFFFFF;
  --weekend: #F7F5F0;
  --ferie: #EEF6F1;
  --aujourdhui: #F1F9F4;
  --danger: #B3261E;
  --col-nom: 220px;
  --col-jour: 72px;
  --ombre: 0 1px 2px rgba(14,27,20,.04), 0 10px 30px rgba(14,27,20,.06);
  --ombre-fenetre: 0 30px 80px rgba(14,27,20,.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--fond);
  color: var(--encre);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--vert-action); outline-offset: 2px; }
[hidden] { display: none !important; }

.liseret { height: 4px; background: var(--vert); }

/* ---------- Barre haute ---------- */
.barre {
  height: 84px; padding: 0 32px; background: var(--blanc); border-bottom: 1px solid var(--ligne);
  display: flex; align-items: center; gap: 24px;
}
.logo { height: 50px; width: auto; display: block; }
.sep { width: 1px; height: 40px; background: var(--ligne); }
.titres { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.titres h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.sous-titre { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--encre-3); }
.annee { display: flex; align-items: center; gap: 8px; background: var(--fond); border: 1px solid var(--ligne); border-radius: 100px; padding: 4px; }
.annee span { min-width: 64px; text-align: center; font-size: 18px; font-weight: 800; }
.rond { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--blanc); display: flex; align-items: center; justify-content: center; transition: background .15s; }
.rond:hover { background: #F0F4F1; }
.rond.contour { border: 1px solid var(--ligne); }
.rond.gris { background: #F3F5F3; }
.rond.gris:hover { background: #E8ECE9; }

.btn { height: 44px; padding: 0 18px; border-radius: 100px; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; transition: background .15s, border-color .15s; white-space: nowrap; }
.btn.carre { border-radius: 12px; }
.btn-plein { background: var(--vert-action); color: #fff; border: none; padding: 0 22px; }
.btn-plein:hover { background: var(--vert-action-fonce); }
.btn-plein:disabled { opacity: .6; cursor: wait; }
.btn-contour { background: var(--blanc); border: 1.5px solid var(--champ); color: var(--encre); }
.btn-contour:hover { background: #F0F4F1; }
.btn-danger { background: transparent; border: none; color: var(--danger); padding: 0 14px; border-radius: 12px; }
.btn-danger:hover { background: #FBEDEC; }
.btn-pointille { background: var(--blanc); border: 1.5px dashed #9AA6A0; color: var(--encre); padding: 0 16px; }
.btn-pointille:hover { background: #F0F4F1; }
.ressort { flex: 1; }

/* ---------- Vue ordinateur ---------- */
.vue-bureau { padding: 20px 32px 32px; display: flex; flex-direction: column; gap: 14px; }
.mois { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 14px; padding: 6px; }
.mois button { height: 40px; border: none; border-radius: 10px; background: transparent; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s; }
.mois button:hover { background: var(--vert-doux); }
.mois button.actif { background: var(--vert-action); color: #fff; }
.mois .point { width: 6px; height: 6px; border-radius: 50%; background: var(--vert); }
.mois button.actif .point { background: #fff; }

.filtres { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filtres .libelle { font-size: 13px; font-weight: 700; color: var(--encre-3); margin-right: 4px; }
.puce { height: 36px; padding: 0 12px 0 5px; border-radius: 100px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; background: var(--blanc); border: 1.5px solid var(--ligne); transition: background .15s; }
.puce.toute { padding: 0 14px; font-weight: 700; }
.puce:hover { background: #F3F7F4; }
.puce.actif { background: var(--vert-doux); border-color: var(--vert-action); }

.avatar { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.avatar.petit { width: 26px; height: 26px; font-size: 11px; }
.avatar.moyen { width: 32px; height: 32px; }
.avatar.grand { width: 48px; height: 48px; font-size: 17px; }

.carte-grille { background: var(--blanc); border: 1px solid var(--ligne); border-radius: 18px; box-shadow: var(--ombre); overflow: hidden; }
.grille-defil { overflow-x: auto; }
.grille-defil::-webkit-scrollbar { height: 10px; }
.grille-defil::-webkit-scrollbar-thumb { background: #CFD8D2; border-radius: 10px; }
.grille-defil::-webkit-scrollbar-track { background: #F3F5F3; }
.grille { display: grid; min-width: max-content; }

.g-titre { position: sticky; left: 0; z-index: 3; background: var(--blanc); height: 68px; padding: 0 18px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--ligne); border-bottom: 1px solid var(--ligne); }
.g-titre strong { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.g-titre span { font-size: 12px; color: var(--encre-3); font-weight: 600; }
.g-jour { height: 68px; border-bottom: 1px solid var(--ligne); border-left: 1px solid var(--ligne-3); display: flex; align-items: center; justify-content: center; }
.g-jour .jj { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.g-jour .dow { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--encre-3); }
.g-jour .num { font-size: 17px; font-weight: 700; line-height: 1; }
.g-jour .fer { font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--vert-texte); }
.g-jour.we .num { color: var(--encre-4); }
.g-jour.ferie .num, .g-jour.ferie .dow { color: var(--vert-texte); }
.g-jour.auj .jj { width: 50px; height: 54px; border-radius: 12px; background: var(--vert-action); color: #fff; justify-content: center; gap: 1px; }
.g-jour.auj .dow, .g-jour.auj .num { color: #fff; }
.g-jour.auj .num { font-size: 18px; font-weight: 800; }

.g-nom { position: sticky; left: 0; z-index: 2; background: var(--blanc); height: 52px; padding: 0 14px; display: flex; align-items: center; gap: 10px; border-right: 1px solid var(--ligne); border-bottom: 1px solid var(--ligne-2); }
.g-nom span:last-child { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-case { height: 52px; padding: 5px 3px; margin: 0; border: none; border-left: 1px solid var(--ligne-3); border-bottom: 1px solid var(--ligne-2); background: var(--blanc); display: flex; align-items: stretch; transition: background .15s; }
.g-case:hover { background: var(--vert-doux) !important; }
.g-case.we { background: var(--weekend); }
.g-case.ferie { background: var(--ferie); }
.g-case.auj { background: var(--aujourdhui); }
.pastille { flex: 1; min-width: 0; border-radius: 8px; font-size: 10px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; padding: 3px 2px; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; -webkit-hyphens: auto; hyphens: auto; overflow-wrap: anywhere; }
.pastille span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.g-vide { grid-column: 1 / -1; padding: 40px; text-align: center; color: var(--encre-3); }

.legende { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--encre-2); font-weight: 600; }
.legende .l { display: flex; align-items: center; gap: 7px; }
.legende .ech { width: 22px; height: 14px; border-radius: 4px; border: 1px solid transparent; }
.legende .barre-v { width: 1px; height: 16px; background: #D9DFDB; }
.legende .astuce { flex: 1; text-align: right; color: var(--encre-3); font-weight: 500; }

/* ---------- Vue téléphone ---------- */
.vue-mobile { display: none; }
.mobile-entete { background: var(--blanc); padding: 12px 16px 14px; border-bottom: 1px solid var(--ligne); display: flex; flex-direction: column; gap: 10px; }
.mobile-nav { display: flex; align-items: center; gap: 8px; }
.mobile-mois { flex: 1; text-align: center; font-size: 15px; font-weight: 800; }
.semaine { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.semaine button { height: 56px; border-radius: 12px; border: none; background: var(--blanc); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.semaine button.we { background: var(--weekend); color: var(--encre-4); }
.semaine button.ferie { background: var(--ferie); color: var(--vert-texte); }
.semaine button.auj { box-shadow: inset 0 0 0 2px var(--vert); }
.semaine button.sel { background: var(--vert-action); color: #fff; box-shadow: none; }
.semaine .dow { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.semaine .num { font-size: 17px; font-weight: 800; line-height: 1; }
.mobile-jour { padding: 14px 16px 6px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--encre-3); }
.mobile-liste { margin: 0 12px 24px; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 16px; overflow: hidden; }
.mobile-liste button { width: 100%; min-height: 54px; padding: 8px 14px; border: none; border-bottom: 1px solid var(--ligne-2); background: var(--blanc); display: flex; align-items: center; gap: 12px; text-align: left; }
.mobile-liste button:last-child { border-bottom: none; }
.mobile-liste .qui { flex: 1; font-size: 15px; font-weight: 700; }
.mobile-liste .etat { padding: 5px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 700; max-width: 55%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-liste .saisir { font-size: 13px; color: var(--encre-4); font-weight: 600; }

/* ---------- Fenêtres ---------- */
.fenetre { border: none; padding: 0; border-radius: 22px; box-shadow: var(--ombre-fenetre); background: var(--blanc); color: var(--encre); max-width: calc(100vw - 32px); }
.fenetre::backdrop { background: rgba(14,27,20,.38); }
.saisie { width: 540px; max-width: 100%; padding: 28px; display: flex; flex-direction: column; gap: 22px; }
.saisie-tete { display: flex; align-items: flex-start; gap: 14px; }
.saisie-qui { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.saisie-nom { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.saisie-date { font-size: 14px; color: var(--encre-2); font-weight: 600; }
.badge { padding: 5px 10px; border-radius: 100px; background: var(--ferie); color: var(--vert-texte); font-size: 12px; font-weight: 700; white-space: nowrap; }
.bloc { display: flex; flex-direction: column; gap: 10px; }
.etiquette { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--encre-3); }
.facultatif { text-transform: none; letter-spacing: 0; font-weight: 600; }
.types { display: flex; flex-wrap: wrap; gap: 8px; }
.types button { height: 40px; padding: 0 14px; border-radius: 100px; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; background: var(--blanc); border: 2px solid #D9DFDB; }
.types .dot { width: 10px; height: 10px; border-radius: 50%; }
textarea { font-size: 15px; line-height: 1.5; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--champ); resize: vertical; background: var(--blanc); min-height: 84px; }
textarea:focus { outline: 2px solid var(--vert-action); outline-offset: 1px; border-color: var(--vert-action); }
.aide { font-size: 12px; color: var(--encre-4); }
.actions { display: flex; align-items: center; gap: 10px; }

.equipe { width: 620px; max-width: 100%; display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.equipe-tete { padding: 26px 28px 18px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--ligne-2); }
.equipe-tete > div { flex: 1; }
.equipe-tete h2 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.equipe-tete p { margin: 2px 0 0; font-size: 13.5px; color: var(--encre-2); }
.equipe-liste { padding: 10px 16px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.membre { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 10px; border-radius: 12px; background: var(--blanc); }
.membre.masque { opacity: .55; }
.membre.glisse { opacity: .4; }
.membre.cible { box-shadow: inset 0 2px 0 var(--vert-action); }
.poignee { color: #9AA6A0; cursor: grab; display: flex; }
.poignee svg { fill: currentColor; stroke: none; width: 16px; height: 16px; }
.membre input[type=text] { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--ligne); font-size: 14.5px; font-weight: 600; background: var(--blanc); }
.membre input[type=text]:focus { border-color: var(--vert-action); outline: none; }
.nuancier { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid var(--ligne); background: var(--blanc); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.nuancier span { width: 20px; height: 20px; border-radius: 6px; pointer-events: none; }
.nuancier input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: none; padding: 0; }
.bascule { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--encre-2); width: 104px; cursor: pointer; flex-shrink: 0; }
.bascule input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bascule .piste { width: 40px; height: 24px; border-radius: 100px; background: #C6CEC9; position: relative; flex-shrink: 0; transition: background .15s; }
.bascule .piste::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.bascule input:checked + .piste { background: var(--vert-action); }
.bascule input:checked + .piste::after { left: 19px; }
.bascule input:focus-visible + .piste { outline: 2px solid var(--vert-action); outline-offset: 2px; }
.equipe-pied { padding: 16px 28px 24px; border-top: 1px solid var(--ligne-2); display: flex; align-items: center; gap: 10px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--encre); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100vw - 32px); }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.erreur { background: var(--danger); }

/* ---------- Écrans moyens ---------- */
@media (max-width: 1180px) {
  .barre { gap: 14px; padding: 0 20px; }
  .vue-bureau { padding: 16px 20px 24px; }
  .mois { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .btn-contour span { display: none; }
  .btn-contour { padding: 0 12px; }
}

/* ---------- Téléphone ---------- */
@media (max-width: 760px) {
  .vue-bureau { display: none; }
  .vue-mobile { display: block; }
  .barre { height: auto; min-height: 64px; padding: 10px 12px; gap: 10px; flex-wrap: nowrap; }
  .logo { height: 34px; }
  .sep, .annee, #btnAujourdhui { display: none; }
  .titres h1 { font-size: 16px; }
  .sous-titre { font-size: 10.5px; letter-spacing: .1em; }
  #btnEquipe { padding: 0 12px; }
  #btnEquipe span { display: none; }
  .fenetre { margin: auto auto 0; border-radius: 22px 22px 0 0; max-width: 100vw; width: 100vw; }
  .saisie, .equipe { width: 100%; padding-bottom: 20px; }
  .saisie { padding: 22px 18px; }
  .membre { gap: 8px; padding: 0 4px; }
  .bascule { width: auto; }
  .bascule .txt { display: none; }
  .equipe-tete, .equipe-pied { padding-left: 18px; padding-right: 18px; }
  .equipe-pied { flex-wrap: wrap; }
}
