/* Espace équipe : pensé pour le téléphone, utilisable au doigt et en plein soleil */
:root {
  --fond: #f4f6f9; --papier: #ffffff; --encre: #17212e; --doux: #556274; --trait: #d6dde6;
  --bleu: #3a6ea5; --bleu-fonce: #2c5b8c; --bleu-clair: #e4edf7; --sur-bleu: #ffffff;
  --vert: #2f7f76; --vert-clair: #e1f1ef; --ambre: #8a4f06; --ambre-clair: #fbf0dc;
  --rouge: #a8322d; --rouge-clair: #fbe7e6;
  --texte: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --barre: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #10161e; --papier: #18212c; --encre: #e6ebf1; --doux: #a3b0c0; --trait: #2a3646;
    --bleu: #82abdd; --bleu-fonce: #9dbde6; --bleu-clair: #1c2b3e; --sur-bleu: #0d1520;
    --vert: #5cc2b5; --vert-clair: #15302d; --ambre: #f0b25c; --ambre-clair: #33270f;
    --rouge: #f08a84; --rouge-clair: #3a1d1c;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--fond); color: var(--encre); font: 17px/1.5 var(--texte); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--bleu); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }
.chargement { padding: 40px 16px; text-align: center; color: var(--doux); }

/* Connexion */
.connexion { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.connexion form { width: 100%; max-width: 380px; display: grid; gap: 14px; background: var(--papier);
                  border: 1px solid var(--trait); border-radius: 16px; padding: 24px; }
.connexion .marque { display: grid; justify-items: center; gap: 8px; text-align: center; margin-bottom: 4px; }
.connexion .marque img { width: 64px; height: 64px; }
.connexion .marque p { color: var(--doux); font-size: .95rem; }

/* Champs et boutons */
.champ { display: grid; gap: 6px; }
.champ label { font-weight: 600; font-size: .95rem; }
.champ small { color: var(--doux); }
input[type=text], input[type=password], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: 48px; background: var(--fond); border: 1px solid var(--trait); border-radius: 10px; padding: 10px 12px; }
textarea { min-height: 80px; }
.cases { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.cases label { display: flex; gap: 8px; align-items: center; min-height: 40px; }
.cases input { width: 20px; height: 20px; }
.bouton { min-height: 48px; border-radius: 10px; border: 2px solid var(--bleu); background: var(--bleu); color: var(--sur-bleu);
          font-weight: 700; padding: 10px 18px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.bouton:disabled { opacity: .6; }
.bouton.secondaire { background: transparent; color: var(--bleu); }
.bouton.danger { background: transparent; border-color: var(--rouge); color: var(--rouge); }
.bouton.petit { min-height: 40px; padding: 6px 12px; font-size: .95rem; }
.bouton.large { width: 100%; }
.lien { background: none; border: none; color: var(--bleu); font-weight: 600; padding: 8px 4px; cursor: pointer; min-height: 40px; }

/* Messages */
.message { border-radius: 10px; padding: 12px 14px; font-size: .97rem; }
.message.erreur { background: var(--rouge-clair); color: var(--rouge); }
.message.info { background: var(--bleu-clair); }
.message.ok { background: var(--vert-clair); }
.message.attention { background: var(--ambre-clair); color: var(--ambre); }

/* Cadre principal */
.entete { position: sticky; top: 0; z-index: 3; background: var(--papier); border-bottom: 1px solid var(--trait);
          padding: calc(10px + env(safe-area-inset-top)) 16px 10px; display: flex; align-items: center; gap: 12px; }
.entete img { width: 32px; height: 32px; flex: none; }
.entete .qui { flex: 1; min-width: 0; }
.entete .qui strong, .entete .qui span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entete .qui span { color: var(--doux); font-size: .85rem; }
main { padding: 16px 16px calc(var(--barre) + 24px + env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto; display: grid; gap: 14px; }
.onglets { position: fixed; bottom: 0; left: 0; right: 0; z-index: 3; background: var(--papier); border-top: 1px solid var(--trait);
           display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding-bottom: env(safe-area-inset-bottom); }
.onglets button { min-height: var(--barre); border: none; background: none; color: var(--doux); font-size: .75rem; font-weight: 600;
                  display: grid; justify-items: center; align-content: center; gap: 2px; cursor: pointer; }
.onglets button svg { width: 24px; height: 24px; }
.onglets button[aria-current="page"] { color: var(--bleu); }

/* Navigation de semaine */
.semaine { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.semaine strong { text-align: center; flex: 1; }
.semaine button { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--trait); background: var(--papier); cursor: pointer; font-size: 1.3rem; }

/* Cartes */
.carte { background: var(--papier); border: 1px solid var(--trait); border-radius: 14px; padding: 14px 16px; display: grid; gap: 8px; }
.carte.aujourdhui { border: 2px solid var(--bleu); }
.carte .titre { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.carte .doux, .doux { color: var(--doux); font-size: .93rem; }
.creneau { border-left: 4px solid var(--bleu); padding: 4px 0 4px 12px; display: grid; gap: 2px; }
.creneau .heures { font-weight: 700; }
.badge { display: inline-block; font-size: .8rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; background: var(--bleu-clair); color: var(--bleu); }
.badge.vert { background: var(--vert-clair); color: var(--vert); }
.badge.ambre { background: var(--ambre-clair); color: var(--ambre); }
.badge.rouge { background: var(--rouge-clair); color: var(--rouge); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.liste { display: grid; gap: 10px; }
.ligne { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--trait); }
.ligne:first-child { border-top: none; }
.ligne .texte { min-width: 0; display: grid; gap: 2px; }
.ligne .texte span { overflow-wrap: anywhere; }
.total { font-weight: 800; font-size: 1.1rem; }
.chiffres { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.chiffre { background: var(--fond); border-radius: 10px; padding: 10px 12px; display: grid; }
.chiffre strong { font-size: 1.3rem; }
.vide { text-align: center; color: var(--doux); padding: 18px 8px; }
.cliquable { cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit; }
.retour { justify-self: start; }
.formulaire { display: grid; gap: 12px; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Indicateur « en attente d'envoi » / « hors ligne » dans l'en-tête */
.entete button.badge { border: 0; font-family: inherit; cursor: pointer; flex: none; }
.entete button.badge[hidden] { display: none; }
.ligne .message { display: block; margin-top: 4px; padding: 6px 10px; font-size: .88rem; }
