/* Volontairement compatible vieux téléphones : flexbox, pas de grid, pas de variables CSS obligatoires.
   Tailles en rem : le site suit la taille de texte réglée dans le téléphone. */

html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }   /* 18 px par défaut */
body { margin: 0; background: #f4f1ea; color: #1d1d1b; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; line-height: 1.45; }
* { box-sizing: border-box; }
a { color: #1f5f8b; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 .6rem; }
p { margin: 0 0 .8rem; }

.dedans { max-width: 640px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.haut { background: #1f5f8b; color: #fff; padding: 16px 0 14px; }
.haut .titre { font-size: 1.25rem; font-weight: 700; }
.haut .sous { font-size: .85rem; opacity: .9; }
.contenu { padding-top: 16px; padding-bottom: 24px; }
.contenu.avec-nav { padding-bottom: 110px; }

/* Navigation en bas, sous le pouce */
.nav { position: fixed; left: 0; right: 0; bottom: 0; display: -webkit-flex; display: flex; background: #fff; border-top: 1px solid #d6d1c4; padding-bottom: env(safe-area-inset-bottom); }
.nav a { -webkit-flex: 1; flex: 1; text-align: center; padding: 8px 2px 10px; font-size: .75rem; color: #5a5a55; text-decoration: none; min-height: 56px; }
.nav .ico { display: block; font-size: 1.5rem; line-height: 1.3; }
.nav a.actif { color: #1f5f8b; font-weight: 700; }

/* Messages */
.message { border-radius: 12px; padding: 14px 16px; font-weight: 600; border: 2px solid; }
.message.ok { background: #e8f5e9; border-color: #2e7d32; color: #1b5e20; }
.message.erreur { background: #fdecea; border-color: #c62828; color: #8e1c1c; }
.doux { color: #5a5a55; font-size: .9rem; }

/* Tuiles et fiches */
.tuile, .fiche { display: block; background: #fff; border: 2px solid #d6d1c4; border-radius: 16px; padding: 16px; margin-bottom: 12px; color: #1d1d1b; text-decoration: none; }
.tuile { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; min-height: 72px; }
.tuile .ico { font-size: 2rem; margin-right: 16px; }
.tuile b { display: block; font-size: 1.1rem; }
.tuile small, .fiche small { color: #5a5a55; font-size: .85rem; }
.fiche b { font-size: 1.05rem; }
.fiche.inactif { opacity: .6; }
.etiquette { display: inline-block; background: #e6f0f7; color: #1f5f8b; border-radius: 8px; padding: 2px 8px; font-size: .8rem; font-weight: 700; margin-left: 6px; }

/* Formulaires */
label { display: block; font-weight: 700; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=time], input[type=password], select {
  width: 100%; font-size: 1.1rem; padding: 14px; border: 2px solid #8a877d; border-radius: 12px; background: #fff; color: #1d1d1b; font-family: inherit; }
input:focus, select:focus, .bouton:focus { outline: 3px solid #f2b705; outline-offset: 2px; }
input.code { text-align: center; font-size: 2rem; font-weight: 700; letter-spacing: .5em; padding-left: .5em; }
.case { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; font-weight: 400; margin: 6px 0; padding: 10px 0; min-height: 48px; }
.case input { width: 28px; height: 28px; margin: 0 14px 0 0; -webkit-flex: none; flex: none; }

.bouton { display: block; width: 100%; text-align: center; background: #1f5f8b; color: #fff; font-size: 1.1rem; font-weight: 700; font-family: inherit; padding: 16px; border: 0; border-radius: 14px; margin-top: 20px; text-decoration: none; cursor: pointer; min-height: 56px; }
.bouton.second { background: #fff; color: #1f5f8b; border: 2px solid #1f5f8b; }
.bouton.danger { background: #fff; color: #c62828; border: 2px solid #c62828; }
.bouton.petit { font-size: .95rem; padding: 10px; min-height: 48px; margin-top: 10px; }

/* Journal */
.ligne-journal { background: #fff; border-bottom: 1px solid #d6d1c4; padding: 10px 12px; font-size: .9rem; }
.ligne-journal b { font-size: .95rem; }
.ligne-journal code { display: block; font-size: .8rem; color: #5a5a55; word-break: break-all; white-space: pre-wrap; }
.filtres { display: -webkit-flex; display: flex; }
.filtres select { -webkit-flex: 1; flex: 1; font-size: .95rem; padding: 10px; margin-right: 8px; }
.filtres .bouton { width: auto; margin-top: 0; padding: 10px 16px; min-height: 0; }

/* Documents */
.fil { font-size: .95rem; line-height: 1.9; }
.fil a { padding: 6px 0; }
.tuile span + span { min-width: 0; word-wrap: break-word; overflow-wrap: break-word; }
.volet { background: #fff; border: 2px solid #d6d1c4; border-radius: 16px; margin: 16px 0 0; padding: 0 16px; }
.volet summary { font-weight: 700; padding: 16px 0; min-height: 56px; cursor: pointer; }
.volet[open] { padding-bottom: 16px; }
.volet form + form { margin-top: 8px; }
input[type=file] { width: 100%; font-size: 1rem; padding: 12px; border: 2px dashed #8a877d; border-radius: 12px; background: #fff; }
.filtres input[type=text] { -webkit-flex: 1; flex: 1; margin-right: 8px; }
[hidden] { display: none !important; }

/* Membres */
textarea { width: 100%; font-size: 1.05rem; padding: 14px; border: 2px solid #8a877d; border-radius: 12px; background: #fff; color: #1d1d1b; font-family: inherit; }
fieldset.fiche { margin-left: 0; margin-right: 0; min-width: 0; }
fieldset.fiche legend { font-weight: 700; padding: 0 8px; }
.etiquette.vert { background: #e8f5e9; color: #1b5e20; }
.etiquette.orange { background: #fff3e0; color: #8a5200; }
.onglets { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 12px 0 4px; }
.onglets a { border: 2px solid #1f5f8b; border-radius: 999px; padding: 8px 14px; margin: 0 8px 8px 0; text-decoration: none; font-weight: 700; font-size: .9rem; background: #fff; }
.onglets a.actif { background: #1f5f8b; color: #fff; }
.colonnes-choix .case { margin: 0; padding: 6px 0; }
.trois-boutons { display: -webkit-flex; display: flex; }
.trois-boutons .bouton { -webkit-flex: 1; flex: 1; margin-right: 8px; padding-left: 6px; padding-right: 6px; }
.trois-boutons .bouton:last-child { margin-right: 0; }

/* Salle */
.etat { display: block; border-radius: 16px; padding: 14px 16px; margin-bottom: 16px; color: #fff; font-weight: 700; text-decoration: none; }
.etat small { display: block; font-weight: 400; font-size: .9rem; margin-top: 2px; }
.etat.libre { background: #2e7d32; }
.etat.option { background: #b26a00; }
.etat.reserve { background: #c62828; }
.mois-nav { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: space-between; justify-content: space-between; margin: 18px 0 8px; font-size: 1.15rem; }
.mois-nav a { display: block; min-width: 56px; padding: 10px 0; text-align: center; text-decoration: none; background: #fff; border: 2px solid #1f5f8b; border-radius: 12px; font-size: 1.2rem; }
table.mois { width: 100%; border-collapse: collapse; table-layout: fixed; background: #fff; }
table.mois th { font-size: .75rem; font-weight: 400; color: #5a5a55; padding: 4px 0; }
table.mois td { border: 1px solid #d6d1c4; padding: 0; text-align: center; vertical-align: top; }
table.mois td a { display: block; min-height: 56px; padding: 6px 0 4px; text-decoration: none; color: #1d1d1b; }
table.mois td b { display: block; font-size: 1.05rem; }
table.mois td small { display: block; font-size: .62rem; line-height: 1.2; }
table.mois td.option { background: #ffd699; }
table.mois td.reserve { background: #f6a5a0; }
table.mois td.partiel.option { background: #fff1d9; }
table.mois td.partiel.reserve { background: #fde0de; }
table.mois td.hors a { opacity: .35; }
table.mois td.passe b { font-weight: 400; color: #5a5a55; }
table.mois td.aujourdhui { outline: 3px solid #1f5f8b; outline-offset: -3px; }
.legende { font-size: .85rem; margin-top: 8px; }
.pastille { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 1px solid #8a877d; vertical-align: -2px; margin: 0 6px 0 12px; -webkit-flex: none; flex: none; }
.legende .pastille:first-child { margin-left: 0; }
.tuile .pastille { margin: 0 16px 0 4px; width: 22px; height: 22px; }
.pastille.libre { background: #fff; }
.pastille.option { background: #f2a73b; }
.pastille.reserve { background: #d9453c; }
.question { font-weight: 700; margin: 18px 0 6px; }
.choix { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; position: relative; }
.choix input[type=radio] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choix > label { -webkit-flex: 1; flex: 1; margin: 0 8px 0 0; text-align: center; padding: 16px 6px; border: 3px solid #8a877d; border-radius: 14px; background: #fff; cursor: pointer; min-height: 56px; }
.choix > label:last-of-type { margin-right: 0; }
.choix > label small { display: block; font-weight: 400; font-size: .8rem; color: #5a5a55; }
.choix input:checked + label { border-color: #1f5f8b; background: #e6f0f7; color: #1f5f8b; }
.choix input:checked + label.option { border-color: #b26a00; background: #fff3e0; color: #8a5200; }
.choix input:checked + label.reserve { border-color: #c62828; background: #fdecea; color: #8e1c1c; }
.choix input:focus + label { outline: 3px solid #f2b705; outline-offset: 2px; }
.choix .horaires { display: none; width: 100%; }
#duree-horaires:checked ~ .horaires { display: block; }

/* Retours d'usage : heures en deux listes, bandeau d'état sous la date */
.heure { display: -webkit-flex; display: flex; }
.heure select { -webkit-flex: 1; flex: 1; }
.heure select + select { margin-left: 8px; }
.horaires label { text-align: left; border: 0; padding: 0; margin: 14px 0 6px; background: none; min-height: 0; }
#etat-jour { margin: 10px 0 0; font-weight: 600; }
#etat-jour:empty { display: none; }
.etat:not(.libre):not(.option):not(.reserve) { background: #5a5a55; }

/* Menu du clic droit (documents) */
.menu-contextuel { position: fixed; z-index: 50; background: #fff; border: 2px solid #1f5f8b; border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.25); padding: 6px; min-width: 240px; }
.menu-contextuel button { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 12px 14px; font-size: 1rem; font-family: inherit; color: #1d1d1b; cursor: pointer; }
.menu-contextuel button:hover, .menu-contextuel button:focus { background: #e6f0f7; outline: none; }
.menu-contextuel button.danger { color: #c62828; }
.voile { position: fixed; z-index: 60; left: 0; top: 0; right: 0; bottom: 0; background: rgba(0,0,0,.45); display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center; padding: 16px; }
.boite { background: #fff; border-radius: 16px; padding: 20px; width: 100%; max-width: 460px; }
.fiche small b { font-size: inherit; }
