/* Maxifiche : base, colonne de navigation, contrôles. Les marques (tampons, gommettes) sont dans marques.css. */
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/static/fonts/atkinson_400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/static/fonts/atkinson_700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* Couleurs, modes clair et sombre, accents et densité : theme.css (système de thèmes de Gaston web). */

* { box-sizing: border-box; }
html { background: var(--fond); }
body {
  margin: 0; min-height: 100vh; background: var(--fond); color: var(--texte);
  font: 15px/1.5 "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  display: grid; grid-template-columns: 256px minmax(0, 1fr); align-items: start;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1 { font-size: 28px; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 18px; line-height: 1.3; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--action); color: var(--sur-action); }
input, textarea { caret-color: var(--action); }
* { scrollbar-color: var(--trait-fort) transparent; scrollbar-width: thin; }
a { color: var(--action); text-underline-offset: 3px; }

/* Colonne de navigation (Gaston web, AppShell et NavLink) : blanche, attachée au bord, séparée du contenu par un filet ;
   entrées à icône au trait, entrée choisie en fond d'accent doux et texte d'accent. */
#cote {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--rail); border-right: 1px solid var(--rail-trait);
  display: flex; flex-direction: column; gap: 18px; padding: 20px 12px 12px; color: var(--rail-texte);
}
#marque { border: 0; background: none; cursor: pointer; font-family: inherit; text-align: left; display: flex; align-items: center; gap: 10px; padding: 0 10px 4px; font-size: 19px; font-weight: 700; color: var(--rail-titre); }
#marque img { width: 30px; height: 30px; border-radius: 8px; }
.titre-cote { font-size: 13px; color: var(--rail-doux); padding: 0 10px; margin: 4px 0 2px; }
.lien {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 38px;
  padding: 8px 10px; border: 0; background: none; border-radius: var(--arrondi-ctrl); text-align: left; color: var(--rail-texte); font-size: 15px;
}
.lien > svg { flex: none; width: 18px; height: 18px; }
.lien > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lien:hover { background: var(--rail-survol); color: var(--rail-titre); }
.lien.actif { background: var(--rail-actif-fond); color: var(--rail-actif-texte); font-weight: 700; }
.lien small { color: var(--rail-doux); font-weight: 400; font-size: 13px; font-variant-numeric: tabular-nums; }
.lien.actif small { color: inherit; }
/* Classes : sous « Mes classes », en retrait, alignées sur le texte des entrées */
#liste-classes { display: grid; gap: 2px; }
#liste-classes .lien { padding-left: 40px; min-height: 34px; font-size: 14px; }
#bas-cote { margin-top: auto; display: grid; gap: 8px; font-size: 13px; color: var(--rail-doux); }
.groupe-cote { display: grid; gap: 2px; }
#cote .bouton { background: none; }
#etat-redaction { display: flex; align-items: center; gap: 8px; padding: 0 2px; }
/* Pied de colonne : le compte, et l'icône des réglages d'affichage à côté (demande de Yann du 30.11.2026) */
#pied { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--rail-trait); padding: 10px 2px 0; }
#compte { flex: 1; min-width: 0; }
.icone { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--arrondi-ctrl); border: 0; background: none; color: var(--rail-doux); }
.icone:hover, .icone[aria-expanded="true"] { background: var(--rail-survol); color: var(--rail-titre); }
.utilisateur { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--rail-texte); font-size: 14px; }
.utilisateur span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.initiale { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--rail-actif-fond); color: var(--rail-actif-texte); font-weight: 700; font-size: 14px; text-transform: uppercase; }
#compte .discret { color: var(--rail-doux); border: 0; padding: 0; min-height: 0; font-size: 13px; }
#compte .discret:hover { color: var(--rail-titre); background: none; }

/* Page */
main { padding: 32px 40px 0; min-width: 0; }
.conteneur { max-width: 1360px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding-bottom: 32px; }
.tete { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sous-titre { color: var(--doux); margin: 4px 0 0; }
/* Cartes blanches sans bordure, ombre douce (Gaston web, « Surfaces ») */
.carte { background: var(--carte); border: var(--bord-carte); border-radius: var(--arrondi-carte); padding: var(--marge-carte); box-shadow: var(--ombre-carte); }
.carte.ombre { box-shadow: var(--ombre); }
.doux { color: var(--doux); font-size: 14px; }
.ligne { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pile { display: grid; gap: 8px; }

/* Boutons */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px;
  border: 1px solid var(--trait-fort); background: var(--panneau); padding: 6px 16px; border-radius: var(--arrondi-bouton); font-weight: 400;
}
.bouton:hover:not(:disabled) { border-color: var(--texte); }
.bouton:disabled { opacity: .5; cursor: not-allowed; }
.principal { background: var(--action); color: var(--sur-action); border-color: var(--action); font-weight: 700; }
.principal:hover:not(:disabled) { background: var(--action-survol); border-color: var(--action-survol); }
.principal.grand { min-height: 44px; padding: 10px 26px; font-size: 16px; }
.discret { background: none; border-color: transparent; color: var(--doux); }
.discret:hover:not(:disabled) { color: var(--texte); border-color: var(--trait); }

/* Champs */
input[type=text], input[type=email], input[type=password], select, textarea {
  background: var(--panneau); border: 1px solid var(--trait-fort); border-radius: var(--arrondi-ctrl); padding: 7px 12px; width: 100%; min-width: 0; min-height: 36px;
}
input::placeholder, textarea::placeholder { color: var(--doux); opacity: 1; }
textarea { resize: vertical; }
input[type=range] { accent-color: var(--action); }
input[type=checkbox] { accent-color: var(--action); width: 16px; height: 16px; }
label.champ { display: grid; gap: 4px; font-size: 14px; font-weight: 400; color: var(--doux); }
label.champ input, label.champ select, label.champ textarea { color: var(--texte); }

/* Choix */
.cartes-choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.choix {
  border: 1px solid var(--trait-fort); border-radius: 8px; background: var(--panneau); padding: 12px 14px;
  text-align: left; display: grid; gap: 2px; position: relative;
}
.choix:hover { border-color: var(--texte); }
.choix.actif { border-color: var(--action); box-shadow: inset 0 0 0 1px var(--action); background: var(--action-doux); }
.choix strong { font-size: 15px; padding-right: 22px; }
.choix span { color: var(--doux); font-size: 14px; }
.segments { justify-self: start; width: max-content; max-width: 100%; display: inline-flex; border: 1px solid var(--trait-fort); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.segments button { border: 0; background: var(--panneau); min-height: 34px; padding: 4px 16px; color: var(--texte); }
.segments button + button { border-left: 1px solid var(--trait); }
.segments button.actif { background: var(--action); color: var(--sur-action); font-weight: 700; }
.segments button:not(.actif):hover { background: var(--survol); }
.segments button.actif:hover { background: var(--action-survol); color: var(--sur-action); }
.puces { display: flex; flex-wrap: wrap; gap: 6px; }
.puce { border: 1px solid var(--trait-fort); background: var(--panneau); border-radius: 999px; min-height: 30px; padding: 3px 12px; font-size: 14px; }
.puce:hover { border-color: var(--texte); }
.puce.actif { background: var(--action); border-color: var(--action); color: var(--sur-action); font-weight: 700; }

@media (max-width: 900px) {
  body { grid-template-columns: 1fr; }
  #cote { position: static; height: auto; }
  main { padding: 20px 16px 0; }
}

/* Menu du compte : s'ouvre au-dessus du nom, en bas de la colonne */
.compte-zone { position: relative; }
button.utilisateur { width: 100%; border: 0; background: none; padding: 4px; border-radius: 8px; text-align: left; }
button.utilisateur:hover { background: var(--rail-survol); }
.menu-compte {
  position: absolute; bottom: calc(100% + 8px); left: 0; width: 230px; z-index: 20; display: grid; gap: 2px; padding: 6px;
  background: var(--carte); color: var(--texte); border: 1px solid var(--trait); border-radius: 14px; box-shadow: var(--ombre-flottante);
}
.menu-compte-tete { display: grid; padding: 6px 8px 8px; border-bottom: 1px solid var(--trait); margin-bottom: 4px; overflow-wrap: anywhere; }
.menu-compte-tete span, .menu-compte-info { color: var(--doux); font-size: 13px; }
.menu-compte-info { padding: 0 8px 4px; }
.menu-compte > button { border: 0; background: none; text-align: left; padding: 8px; border-radius: 6px; min-height: 36px; }
.menu-compte > button:hover { background: var(--survol); }

/* Apparence : nuancier des couleurs d'accent (apparence.js) */
.titre-reglage { font-size: 13px; color: var(--doux); }
.nuancier { display: flex; flex-wrap: wrap; gap: 8px; }
.nuancier button { flex: none; width: 28px; height: 28px; min-height: 0; padding: 0; border-radius: 6px; border: 0; background: var(--pastille); box-shadow: 0 0 0 2px var(--carte), 0 0 0 3px transparent; }
.nuancier button:hover { box-shadow: 0 0 0 2px var(--carte), 0 0 0 3px var(--trait-fort); }
.nuancier button.actif { box-shadow: 0 0 0 2px var(--carte), 0 0 0 4px var(--pastille); }
.icone.actif { background: var(--rail-actif-fond); color: var(--rail-actif-texte); }
.icone svg { width: 18px; height: 18px; }
#pied { position: relative; }

/* « + » et « ⋮ » des cartes (actions.js, repris de Gaston web) */
.bouton-rond { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--trait); background: var(--carte); color: var(--texte-2); }
.bouton-rond svg { width: 18px; height: 18px; }
.bouton-rond:hover { border-color: var(--trait-fort); color: var(--texte); }
.bouton-rond.plein { background: var(--action); border-color: var(--action); color: var(--sur-action); }
.bouton-rond.plein:hover { background: var(--action-survol); border-color: var(--action-survol); color: var(--sur-action); }
.zone-actions { position: relative; }
.menu-actions {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 220px; display: grid; gap: 2px; padding: 6px;
  background: var(--carte); border: 1px solid var(--trait); border-radius: 14px; box-shadow: var(--ombre-flottante);
}
.menu-actions button, .menu-actions a { border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; color: var(--texte); text-decoration: none; font-size: 15px; }
.menu-actions button:hover, .menu-actions a:hover, .menu-actions :focus-visible { background: var(--survol); }
/* En-tête de page : « + » de 40 px comme dans Gaston web (apps/association/DESIGN.md, « Actions »). */
.tete .bouton-rond, .tete-classe .bouton-rond { width: 40px; height: 40px; }
/* Choix du thème (comme la page Affichage de Gaston : nom et description) ; carré de la couleur du thème devant. */
.choix-themes { display: grid; gap: 2px; }
.choix-themes button { display: flex; align-items: center; gap: 10px; border: 1px solid transparent; background: none; text-align: left; padding: 6px 8px; border-radius: 8px; color: var(--texte); }
.choix-themes button:hover { background: var(--survol); }
.choix-themes button.actif { border-color: var(--action); background: var(--action-doux); }
.choix-themes strong { font-size: 14px; }
.choix-themes small { color: var(--doux); font-size: 12px; line-height: 1.3; }
.apercu-theme { flex: none; width: 22px; height: 22px; border-radius: 6px; background: var(--pastille); }

/* Mes préférences (preferences.js) : une carte par groupe, une ligne par réglage, titre à gauche et contrôle à droite. */
.groupe-reglages { display: grid; padding-top: 14px; padding-bottom: 4px; }
.groupe-reglages > h2 { margin: 0 0 4px; }
.ligne-reglage { display: grid; grid-template-columns: minmax(180px, 240px) 1fr; gap: 6px 28px; padding: 16px 0; border-top: 1px solid var(--trait); }
.groupe-reglages > h2 + .ligne-reglage { border-top: 0; }
.reglage-titre p { margin: 4px 0 0; font-size: 13px; line-height: 1.4; }
.reglage-controle { min-width: 0; }
.ligne-reglage .choix-themes { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.demandes-recentes summary { cursor: pointer; color: var(--action); }
@media (max-width: 760px) { .ligne-reglage { grid-template-columns: 1fr; } }

/* Icône devant chaque bouton (icones_boutons.js, décision de Yann du 30.11.2026). */
.icone-bouton { display: inline-grid; place-items: center; flex: none; margin-left: -4px; }
.icone-bouton svg { width: 16px; height: 16px; }
.principal.grand .icone-bouton svg { width: 18px; height: 18px; }
.choix-action { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: start; text-align: left; }
.choix-action > .icone-bouton { grid-row: span 2; margin: 2px 0 0; width: 36px; height: 36px; border-radius: 50%; background: var(--action-doux); color: var(--action); }
.choix-principal.choix-action > .icone-bouton { background: rgb(255 255 255 / .16); color: var(--sur-action); }
.choix-action > .icone-bouton svg { width: 20px; height: 20px; }
