:root {
  --fond: #f5f6f8;
  --carte: #ffffff;
  --texte: #1c2330;
  --doux: #5d6675;
  --bord: #dde1e7;
  --accent: #1f5fbf;
  --accent-fonce: #174a96;
  --ok-fond: #e6f4ea;
  --ok-texte: #1e6b34;
  --err-fond: #fdecea;
  --err-texte: #a4271b;
  --info-fond: #e8f0fb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fond);
  color: var(--texte);
}

.wrap { max-width: 960px; margin: 0 auto; padding-inline: 16px; }
main.wrap { padding-block: 32px 64px; }

.top { background: var(--carte); border-bottom: 1px solid var(--bord); }
.top-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-block: 14px; }
.brand { font-weight: 700; color: var(--texte); text-decoration: none; margin-right: auto; }
.who { color: var(--doux); font-size: 14px; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: 15px; }

h1 { font-size: 26px; margin: 0 0 16px; }
h2 { font-size: 18px; margin: 0 0 14px; }
a { color: var(--accent); }

.carte {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: 10px;
  padding: 24px;
  margin-block: 20px;
}
.etroite { max-width: 440px; margin-inline: auto; }

label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
input, select {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 400;
  border: 1px solid var(--bord);
  border-radius: 6px;
  background: #fff;
}
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid #9dbcf0; outline-offset: 1px; }

button, .bouton {
  display: inline-block;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .bouton:hover { background: var(--accent-fonce); }
button.secondaire { background: #fff; color: var(--texte); border: 1px solid var(--bord); }
button.secondaire:hover { background: var(--fond); }
button.lien { background: none; color: var(--accent); padding: 0; font-weight: 400; text-decoration: underline; }
.danger, button.lien.danger { color: var(--err-texte); }

form.inline { display: inline; }
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; align-items: end; }
.grille button { margin-bottom: 14px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }

.aide { color: var(--doux); font-weight: 400; }
.petit { font-size: 13px; }
.vide { color: var(--doux); font-style: italic; }

.flash { padding: 10px 14px; border-radius: 6px; margin: 0 0 16px; }
.flash.ok { background: var(--ok-fond); color: var(--ok-texte); }
.flash.erreur { background: var(--err-fond); color: var(--err-texte); }
.flash.info { background: var(--info-fond); }

.liste { list-style: none; padding: 0; margin: 0; }
.liste li {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px;
  padding: 14px 0; border-bottom: 1px solid var(--bord);
}
.liste li:last-child { border-bottom: 0; }
main > .liste { background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding-inline: 20px; }

.table-scroll { overflow-x: auto; background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--bord); white-space: nowrap; }
th { font-size: 13px; color: var(--doux); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tr.inactif td { color: var(--doux); }

.identifiants { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 20px 0; }
.identifiants dt { color: var(--doux); }
.identifiants dd { margin: 0; }
code { font-size: 17px; background: var(--fond); padding: 2px 6px; border-radius: 4px; }

/* Drag-and-drop upload */
.depot {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 28px 16px; margin-bottom: 18px; text-align: center;
  border: 2px dashed #b7c3d6; border-radius: 10px; background: #fafbfd; cursor: pointer;
  font-weight: 400;
}
.depot.survol { border-color: var(--accent); background: var(--info-fond); }
.depot.rempli { border-style: solid; border-color: var(--ok-texte); }
.depot-titre { font-size: 18px; font-weight: 600; }
.depot input[type=file] { width: auto; max-width: 100%; border: 0; background: none; padding: 4px; }
.fichiers { list-style: none; padding: 0; margin: 4px 0; font-size: 14px; }
.fichiers:empty { display: none; }

fieldset.destinataires { border: 1px solid var(--bord); border-radius: 8px; padding: 12px 16px 4px; margin: 0 0 18px; }
legend { font-weight: 600; font-size: 14px; padding: 0 6px; }
.cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 16px; max-height: 260px; overflow-y: auto; }
label.case { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-bottom: 10px; }
label.case input { width: auto; margin: 0; }
label.tous { font-weight: 600; }

.pastille { display: inline-block; font-size: 12px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 99px; padding: 1px 8px; vertical-align: middle; }
.filtres { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.filtres a { padding: 5px 12px; border: 1px solid var(--bord); border-radius: 99px; background: var(--carte); text-decoration: none; font-size: 14px; }
.filtres a.actif { background: var(--accent); border-color: var(--accent); color: #fff; }
td.detail { white-space: normal; min-width: 240px; }
button:disabled { opacity: .6; cursor: wait; }

/* Email + access-code controls */
.ligne-courriel { display: flex; gap: 6px; align-items: center; }
.ligne-courriel input { width: 190px; margin-top: 0; padding: 6px 8px; font-size: 14px; }
.ligne-courriel.large input { width: 280px; padding: 10px 12px; font-size: 16px; }
.petit-bouton { padding: 6px 10px; font-size: 14px; white-space: nowrap; }
button:disabled { opacity: .5; cursor: not-allowed; }
textarea.message {
  width: 100%; margin-top: 6px; padding: 12px; font: 14px/1.5 ui-monospace, Consolas, monospace;
  border: 1px solid var(--bord); border-radius: 6px; background: var(--fond); resize: vertical;
}

/* Employee cards: no horizontal scrolling, even on a phone */
.wrap { max-width: 1040px; }
.fiches { list-style: none; margin: 0 0 20px; padding: 0 20px; background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; }
.fiche { padding: 16px 0; border-bottom: 1px solid var(--bord); }
.fiche:last-child { border-bottom: 0; }
.fiche.inactif { opacity: .65; }
.fiche-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.fiche-tete .etat { margin-left: auto; font-size: 13px; color: var(--doux); white-space: nowrap; }
.fiche-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 10px; }
.ligne-courriel input { width: 100%; max-width: 230px; min-width: 0; }
.grille { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
table { white-space: normal; }
th, td { white-space: normal; }

/* Pay-stub confirmation list */
.fiches.sans-cadre { background: none; border: 0; border-radius: 0; padding: 0; }
.fiche.avertir { background: #fffbe9; border-left: 3px solid #d98b00; padding-left: 12px; }
.fiche .etat.danger { color: var(--err-texte); font-weight: 600; }
.fiche-actions select, .fiche-actions input[type=date] { width: auto; min-width: 150px; margin-top: 0; padding: 7px 10px; font-size: 14px; }
label.sr { font-weight: 400; margin: 0; font-size: 12px; color: var(--doux); }

/* Pay-stub confirmation list */
.fiches.sans-cadre { background: none; border: 0; border-radius: 0; padding: 0; }
.fiche.avertir { background: #fffbe9; border-left: 3px solid #d98b00; padding-left: 12px; }
.fiche .etat.danger { color: var(--err-texte); font-weight: 600; }
.fiche-actions select, .fiche-actions input[type=date] { width: auto; min-width: 150px; margin-top: 0; padding: 7px 10px; font-size: 14px; }
label.sr { font-weight: 400; margin: 0; font-size: 12px; color: var(--doux); }
