/* Administration : navigation, onglets, tableaux d'équipe, dialogue des accès. */

.navigation { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.25rem; margin-left: auto; }

.navigation a {
  padding: .3rem .1rem;
  border-bottom: 2px solid transparent;
  color: #e6ece7;
  font-weight: 500;
  font-size: .98rem;
  text-decoration: none;
  transition: color .15s, border-color .15s;
}

.navigation a:hover { color: var(--genet); border-bottom-color: var(--genet); }
.navigation button { min-height: 36px; }

/* Barre d'onglets, avec l'aide de l'onglet ouvert toujours visible au bout. */
.barre-onglets { display: flex; align-items: center; gap: .6rem; margin: 1.25rem 0 1.5rem; }
.barre-onglets .onglets { flex: 1; min-width: 0; margin: 0; }
.barre-onglets button.info { width: 1.7rem; height: 1.7rem; margin: 0; font-size: .95rem; }

/* Onglets : l'onglet ouvert en vert bocage, souligné d'or ; sur téléphone, ils défilent sur une ligne. */
.onglets {
  display: flex;
  gap: .3rem;
  margin: 1.25rem 0 1.5rem;
  padding: .35rem;
  overflow-x: auto;
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  background: var(--surface);
}

.onglets a {
  padding: .5rem .95rem;
  border-radius: 6px;
  color: var(--discret);
  font-family: var(--police-titres);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s, color .15s;
}

.onglets a:hover { background: var(--survol); color: var(--titre); }
.onglets a[aria-current="page"] { background: var(--vert); color: #fff; box-shadow: inset 0 -3px 0 var(--genet); }

h3 { margin: 1.5rem 0 .6rem; }

.formulaire.en-ligne { max-width: none; display: flex; flex-wrap: wrap; align-items: end; }
.formulaire.en-ligne > label { flex: 1 1 9rem; }
.formulaire.en-ligne > .erreur, .formulaire.en-ligne > .message-ok { flex-basis: 100%; }

.cases { display: grid; gap: .4rem; margin: 0; padding: .6rem .85rem .75rem; border: 1px solid var(--bord); border-radius: 8px; }

.cases legend {
  padding: 0 .3rem;
  color: var(--titre);
  font-family: var(--police-titres);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.cases label { font-weight: 400; }

/* Pas de display:flex sur la cellule : elle perdrait son comportement de cellule (bordure, hauteur). */
.actions-ligne { text-align: right; white-space: nowrap; }
.actions-ligne > * + * { margin-left: .4rem; }
.actions-ligne button { min-height: 36px; padding: 0 .8rem; font-size: .95rem; }

.message-actu { white-space: pre-line; overflow-wrap: anywhere; min-width: 14rem; }

.vignette { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; vertical-align: middle; }
.cellule-photo .erreur { white-space: normal; }

/* Zone sensible (suppression) : encadré pointillé, comme les encarts de la charte. */
.zone-sensible { margin-top: 2rem; padding: .25rem 1.1rem 1.1rem; border: 2px dashed var(--erreur); border-radius: var(--rayon); background: var(--surface); }
.zone-sensible h2 { color: var(--erreur); }

tr.revoque td { color: var(--discret); text-decoration: line-through; }
tr.revoque td:last-child { text-decoration: none; }
tr.refuse td { color: var(--erreur); }

.bandeau-cloture {
  padding: .65rem 1rem;
  border: 1px solid var(--ok);
  border-left: 4px solid var(--ok);
  border-radius: 8px;
  color: var(--ok);
  font-weight: 600;
}

/* Ce qui suit un champ « heure à la seconde » doit rester assez large. */
.formulaire.en-ligne input[type="datetime-local"] { min-width: 14rem; }

.liens { display: grid; gap: .75rem; padding-left: 1.2rem; }
.aide { color: var(--discret); font-size: .95rem; }

dialog {
  width: min(28rem, calc(100% - 2rem));
  border: 1px solid var(--bord);
  border-top: 4px solid var(--genet);
  border-radius: 12px;
  box-shadow: var(--ombre);
  background: var(--surface);
  color: var(--texte);
}

dialog::backdrop { background: rgb(11 23 18 / .55); }
dialog h2 { margin-top: 0; }
.actions-dialogue { display: flex; justify-content: flex-end; margin-top: 1rem; }

/* QR code toujours sur fond blanc, même en thème sombre, pour rester lisible par les appareils photo. */
.qr { display: block; width: 240px; max-width: 100%; height: auto; margin: 0 auto; padding: 8px; background: #fff; border-radius: 8px; }

.pin { font-size: 1.2rem; text-align: center; }
.pin strong { font-family: var(--police-titres); font-size: 2.4rem; font-weight: 800; letter-spacing: .2em; color: var(--chiffre); font-variant-numeric: tabular-nums; }

.lien-long { overflow-wrap: anywhere; font-size: .9rem; }

/* --- Téléphone --- */

.bouton-menu { display: none; }
.onglets { scrollbar-width: none; }
.onglets::-webkit-scrollbar { display: none; }

@media (max-width: 760px) {
  /* Navigation repliée derrière un bouton « Menu », dépliée sous l'en-tête. */
  .entete .conteneur { position: relative; }
  .bouton-menu { display: inline-flex; align-items: center; gap: .45rem; margin-left: auto; }
  .bouton-menu::before { content: "☰"; font-size: 1.1rem; line-height: 1; }
  .entete.menu-ouvert .bouton-menu::before { content: "✕"; }

  .navigation {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: .25rem 0 1rem;
    background: var(--vert);
    border-top: 1px solid rgb(255 255 255 / .15);
    box-shadow: 0 12px 24px -10px rgb(0 0 0 / .5);
  }

  .entete.menu-ouvert .navigation { display: flex; }
  .navigation a { padding: .8rem 1rem; border-bottom: 1px solid rgb(255 255 255 / .08); font-size: 1.05rem; }
  .navigation a:hover { border-bottom-color: rgb(255 255 255 / .08); background: rgb(255 255 255 / .06); }
  .navigation button { margin: .75rem 1rem 0; min-height: 44px; }

  /* Formulaires « sur une ligne » : empilés, bouton sur toute la largeur. */
  .formulaire.en-ligne > label { flex-basis: 100%; }
  .formulaire.en-ligne .actions, .formulaire.en-ligne .actions button { width: 100%; }

  /* Tableaux : une carte par ligne, chaque valeur précédée du titre de sa colonne. */
  #vue .defilant { overflow: visible; border: 0; background: transparent; }
  #vue .tableau thead { display: none; }
  #vue .tableau, #vue .tableau tbody, #vue .tableau tr, #vue .tableau td { display: block; width: 100%; }
  #vue .tableau tbody { display: grid; gap: .6rem; }

  #vue .tableau tr {
    padding: .65rem .9rem;
    border: 1px solid var(--bord);
    border-radius: var(--rayon);
    background: var(--surface);
  }

  #vue .tableau td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: .25rem 0;
    border: 0;
    text-align: right;
    overflow-wrap: anywhere;
  }

  #vue .tableau td[data-libelle]::before {
    content: attr(data-libelle);
    flex-shrink: 0;
    color: var(--discret);
    font-family: var(--police-titres);
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-align: left;
  }

  #vue .tableau td:empty { display: none; }
  #vue .tableau td.actions-ligne { justify-content: flex-start; flex-wrap: wrap; gap: .4rem; padding-top: .5rem; white-space: normal; }
  #vue .tableau td.actions-ligne::before { content: none; }
  #vue .tableau td.actions-ligne > * + * { margin-left: 0; }
  .message-actu { min-width: 0; text-align: left; }
}
