:root {
  --texte: #1d1d1f; --doux: #5f6368; --fond: #f6f6f4; --carte: #fff; --bord: #d9d9d6;
  --accent: #1f4e79; --erreur: #a4262c; --ok: #1e6b3a; --vide: #ececea;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--texte); background: var(--fond); }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.5rem; margin: 0 0 12px; }
h2 { font-size: 1.15rem; margin: 0 0 10px; }
a { color: var(--accent); }
.barre { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; padding: 10px 16px; background: #23272e; color: #fff; }
.barre a { color: #fff; text-decoration: none; }
.barre .marque { font-weight: 700; margin-right: auto; }
.barre nav { display: flex; gap: 14px; flex-wrap: wrap; }
.barre .deco { margin: 0; }
.lien { background: none; border: 0; color: #cfd6df; font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.etroite { max-width: 420px; margin: 24px auto; }
label { display: block; margin: 0 0 12px; font-weight: 600; }
input, select { display: block; width: 100%; margin-top: 4px; padding: 10px; font: inherit; border: 1px solid var(--bord); border-radius: 6px; min-height: 44px; }
button, .bouton { display: inline-block; min-height: 44px; padding: 10px 16px; font: inherit; font-weight: 600; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; }
.secondaire { background: #fff; color: var(--accent); }
.aide { color: var(--doux); font-weight: 400; font-size: .9rem; }
.grand { font-size: 1.2rem; }
.message { padding: 10px 14px; border-radius: 6px; background: #eef3f8; }
.message.erreur { background: #fbeaea; color: var(--erreur); }
.message.ok { background: #e8f4ec; color: var(--ok); }
.gardes { list-style: none; padding: 0; margin: 0 0 12px; }
.gardes li { padding: 8px 0; border-bottom: 1px solid var(--bord); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.gardes .dates { font-weight: 600; min-width: 18em; }
.gardes .nature { color: var(--doux); }
.entete-planning { display: flex; align-items: center; gap: 12px; }
.entete-planning h1 { margin: 0; flex: 1; text-align: center; }
.outils { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 12px 0; }
.en-ligne { display: flex; gap: 8px; align-items: end; margin: 0; }
.en-ligne label { margin: 0; }
.grille { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.grille th { background: #23272e; color: #fff; padding: 6px; font-size: .85rem; border-radius: 4px; }
.grille td { vertical-align: top; height: 92px; padding: 6px; border-radius: 6px; color: #111; }
.grille td.hors { background: transparent; }
.grille td.vide { background: var(--vide); color: var(--doux); }
.num { font-size: .8rem; color: #333; }
.ferie { font-size: .72rem; font-weight: 600; }
.nom-secondaire { text-align: center; font-size: .85rem; overflow-wrap: anywhere; }
.nom-principal { text-align: center; font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.mien { outline: 3px solid #111; outline-offset: -3px; }
.aujourdhui .num { font-weight: 700; text-decoration: underline; }
.badge { display: inline-block; margin-top: 4px; font-size: .7rem; padding: 1px 6px; border-radius: 8px; background: #fff; border: 1px dashed #555; }
.liste-mois { display: none; list-style: none; padding: 0; margin: 0; }
.liste-mois li { display: flex; gap: 10px; align-items: baseline; padding: 10px; margin-bottom: 3px; border-radius: 6px; color: #111; }
.liste-mois li.vide { background: var(--vide); }
.liste-mois .date { width: 4.2em; font-weight: 600; }
.liste-mois .qui { font-weight: 700; flex: 1; }
.liste-mois li.we { box-shadow: inset 6px 0 0 rgba(0, 0, 0, .35); }
.legende { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 16px 0 4px; }
.legende li { padding: 4px 10px; border-radius: 6px; color: #111; font-size: .9rem; }
.actions { margin: 8px 0; }
@media (max-width: 700px) {
  .grille { display: none; }
  .liste-mois { display: block; }
  .gardes .dates { min-width: 0; }
}

/* Saisie, équipe, décompte, coordination */
.alerte { background: #fbeaea; border: 2px solid var(--erreur); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; }
.alerte h2 { color: var(--erreur); }
.c-v { background: #f4b183; }
.c-i { background: #c9c9c9; background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(0,0,0,.12) 6px 8px); }
.c-plus { background: #b7e1b2; }
.c-moins { background: #f3e7a8; }
.c-vide { background: #fff; }
fieldset { border: 0; padding: 0; margin: 0 0 10px; }
legend { font-weight: 600; margin-bottom: 6px; }
.outils-codes { display: flex; flex-wrap: wrap; gap: 6px; }
.pastille { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 8px 12px; border: 1px solid var(--bord); border-radius: 20px; font-weight: 600; cursor: pointer; min-height: 44px; }
.pastille input { width: auto; min-height: 0; margin: 0; display: inline; }
.pastille:has(input:checked) { outline: 3px solid #111; }
.confirmation { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; color: var(--erreur); }
.confirmation input { width: auto; min-height: 0; margin-top: 4px; display: inline; }
.grille.saisie td { height: auto; padding: 0; background-color: #fff; }
.grille.saisie td.we { background-color: #e9e9e6; }
.grille.saisie td.c-v { background: #f4b183; }
.grille.saisie td.c-i { background-color: #c9c9c9; }
.grille.saisie td.c-plus { background: #b7e1b2; }
.grille.saisie td.c-moins { background: #f3e7a8; }
.jour { width: 100%; min-height: 56px; padding: 4px; border: 0; border-radius: 6px; background: transparent; color: #111; display: flex; flex-direction: column; align-items: center; font-weight: 400; }
.jour:disabled { opacity: .35; cursor: default; }
.jour .code { font-weight: 800; font-size: 1.1rem; min-height: 1.2em; }
.jour .garde { font-size: .65rem; font-weight: 700; background: #111; color: #fff; border-radius: 6px; padding: 0 5px; }
.jour .ferie { font-size: .6rem; }
.deux-colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.defile { overflow-x: auto; }
table.equipe { border-collapse: collapse; font-size: .85rem; }
table.equipe th, table.equipe td { border: 1px solid var(--bord); padding: 3px 4px; text-align: center; min-width: 26px; }
table.equipe th[scope=row] { text-align: left; position: sticky; left: 0; background: var(--carte); }
table.equipe .we { background-color: #f0f0ee; }
table.equipe td.c-v { background: #f4b183; font-weight: 700; }
table.equipe td.c-i { font-weight: 700; background-color: #c9c9c9; }
table.equipe tr.moi th { text-decoration: underline; }
table.equipe tr.total td { font-weight: 700; }
.peu { background: #f8d0d0 !important; color: var(--erreur); font-weight: 800; }
table.decompte { border-collapse: collapse; min-width: 420px; }
table.decompte th, table.decompte td { padding: 6px 10px; border-bottom: 1px solid var(--bord); text-align: right; }
table.decompte th[scope=row], table.decompte thead th:first-child { text-align: left; }
table.decompte tr.synthese { background: #f2f2f2; font-weight: 700; }
h3 { font-size: 1rem; margin: 14px 0 6px; }
@media (max-width: 700px) {
  .grille.saisie { display: table; }
  .jour { min-height: 48px; }
  .jour .ferie { display: none; }
}

/* Administration */
table.admin { border-collapse: collapse; width: 100%; font-size: .92rem; }
table.admin th, table.admin td { padding: 8px 6px; border-bottom: 1px solid var(--bord); text-align: left; vertical-align: middle; }
table.admin tr.inactif { color: var(--doux); }
table.admin select { min-height: 36px; padding: 4px; margin: 0; width: auto; display: inline-block; }
.petit { min-height: 36px; padding: 6px 10px; font-size: .85rem; }
.actions-ligne { display: flex; flex-wrap: wrap; gap: 6px; }
.actions-ligne form { margin: 0; }
.grille-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: end; margin-bottom: 10px; }
.grille-form label { margin: 0; }
.grille-form input[type=color] { padding: 2px; height: 44px; }
.case { display: flex; gap: 8px; align-items: center; }
.case input { width: auto; min-height: 0; margin: 0; }
.ligne-medecin { padding-bottom: 10px; border-bottom: 1px solid var(--bord); }
.pastille-medecin { display: inline-block; padding: 10px 12px; border-radius: 6px; font-weight: 700; color: #111; align-self: center; }
.bloc-periode { border-top: 1px solid var(--bord); padding-top: 8px; margin-top: 8px; }
.feries { list-style: none; padding: 0; margin: 8px 0; }
.feries li { padding: 4px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lien-danger { background: none; border: 0; color: var(--erreur); text-decoration: underline; cursor: pointer; padding: 0; min-height: 0; font: inherit; font-size: .85rem; }
.mdp { font: 700 1.5rem/1.3 ui-monospace, monospace; letter-spacing: .05em; background: #f2f2f2; padding: 12px; border-radius: 6px; text-align: center; user-select: all; }
.qr img { display: block; margin: 8px auto; background: #fff; padding: 8px; border: 1px solid var(--bord); }
code.cle { word-break: break-all; }
.numeros { font-size: 1.1rem; font-weight: 600; margin-top: -6px; }
