/* Accueil — vignettes déplaçables et tiroir de composition (roadmap
   d'octobre 2026). Complète la section 16 de app.css. */


/* ── Mosaïque (js/mosaique.js) ───────────────────────────────────────
   Des rangées de 1 px : chaque vignette en occupe autant que sa hauteur
   plus l'écart (--rangs, calculé en JS). L'écart vertical est donc compris
   dans ce calcul, d'où row-gap à 0 : il vaut exactement l'écart entre les
   colonnes, partout. */
.widgets-grid.en-mosaique {
  grid-auto-rows: 1px;
  row-gap: 0;
  align-items: start;
}
.widgets-grid.en-mosaique > .acc-tuile { grid-row-end: span var(--rangs, 1); }

/* ── Univers : la couleur d'une vignette ─────────────────────────────
   Chaque vignette porte la couleur de son univers (Pilotage, Commerce,
   Achats, Finance, Équipe — les groupes du rail) : sur l'étiquette en tête
   et sur la pastille d'icône, nulle part ailleurs. */
.univers-pilotage { --univers: var(--univers-pilotage); }
.univers-commerce { --univers: var(--univers-commerce); }
.univers-achats   { --univers: var(--univers-achats); }
.univers-finance  { --univers: var(--univers-finance); }
.univers-equipe   { --univers: var(--univers-equipe); }

.acc-tuile {
  --univers-voile: color-mix(in srgb, var(--univers, var(--petrole)) 16%, transparent);
  transition: border-color var(--temps) var(--courbe), box-shadow var(--temps) var(--courbe);
}
/* Un filet plein de la couleur de l'univers, sur toute la largeur du haut
   de la vignette : un repère qui se lit avant le texte et se mémorise
   (« la Trésorerie, c'est la vert sapin »). Posé en bordure haute plutôt
   qu'en pseudo-élément : il épouse les coins arrondis, et ne bouge pas au
   survol quand le reste du contour fonce. */
.acc-tuile { border-top: 3px solid var(--univers, var(--petrole)); }
.acc-tuile:hover {
  border-color: var(--trait-fort);
  border-top-color: var(--univers, var(--petrole));
  box-shadow: var(--ombre-survol);
}

/* Tête : poignée, univers, retrait. */
.acc-tete { align-items: center; gap: .35rem; margin: -.45rem -.4rem .55rem -.55rem; }
.acc-univers {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--univers, var(--petrole));
}
.acc-univers::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* La poignée : toujours visible (avant, elle n'apparaissait qu'au survol et
   on ne savait pas qu'une vignette se déplaçait). Six points, la main
   ouverte au survol, la main fermée pendant le glisser. */
.acc-poignee {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  min-height: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--r-petit);
  background: none;
  color: var(--poignee);
  cursor: grab;
  touch-action: none;
}
.acc-poignee svg { width: 15px; height: 15px; }
.acc-poignee:hover { background: var(--voile); border-color: var(--trait); color: var(--encre); }
.acc-poignee:active { cursor: grabbing; transform: none; }
.acc-tuile.glisse-saisi .acc-poignee { color: var(--orange); }

.acc-titre { margin: 0 0 .9rem; font-size: var(--t-base); font-weight: 600; color: var(--encre); }

.acc-retirer {
  flex: none;
  width: 26px;
  min-height: 26px;
  height: 26px;
  padding: 0;
  border-color: transparent;
  color: var(--gris);
  opacity: 0;
  transition: opacity var(--temps) var(--courbe);
}
.acc-retirer svg { width: 13px; height: 13px; }
.acc-tuile:hover .acc-retirer, .acc-retirer:focus-visible { opacity: 1; }
.acc-retirer:hover { color: var(--danger); background: var(--refus-fond); border-color: transparent; }

/* Raccourci : une icône, un titre, une phrase — plus parlant qu'un mot. */
.acc-raccourci { justify-content: flex-start; gap: .9rem; cursor: pointer; }
.acc-raccourci > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: .1rem; }
.acc-raccourci strong { font-weight: 500; color: var(--encre); font-size: var(--t-l); }
.acc-raccourci:hover strong { color: var(--univers, var(--petrole)); }
.acc-raccourci .muted { font-size: var(--t-s); font-weight: 400; color: var(--gris); }
.acc-raccourci-icone {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-moyen);
  background: var(--univers-voile);
  color: var(--univers, var(--petrole));
}
.acc-raccourci-icone svg { width: 20px; height: 20px; }
.acc-raccourci .fleche { color: var(--univers, var(--orange)); transition: transform var(--temps) var(--courbe); }
.acc-raccourci:hover .fleche { transform: translateX(3px); }

.acc-lien { display: inline-flex; align-items: center; gap: .35rem; margin-top: 1rem; font-size: var(--t-m); color: var(--petrole); text-decoration: none; }
.acc-lien svg { width: 14px; height: 14px; }
.acc-lien:hover { text-decoration: underline; }

.acc-absents { list-style: none; margin: 0; padding: 0; }
.acc-absents li { display: flex; flex-direction: column; padding: .5rem 0; border-bottom: 1px solid var(--trait); font-size: var(--t-base); }
.acc-absents li:last-child { border-bottom: none; }
.acc-absents span { font-size: var(--t-s); color: var(--gris); }

/* ── Tiroir « Composer mon accueil » ────────────────────────────────── */
.acc-choix-titre { margin: 0 0 .7rem; font-size: var(--t-s); font-weight: 600; color: var(--gris); }
.acc-choix-titre:not(:first-child) { margin-top: 1.75rem; }
.acc-choix-grille { display: grid; gap: .5rem; }
.acc-choix {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: .85rem;
  width: 100%;
  min-height: 64px;
  padding: .7rem .85rem;
  border: 1px solid var(--trait);
  border-radius: var(--r-moyen);
  background: var(--surface);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color var(--temps) var(--courbe), background var(--temps) var(--courbe);
}
.acc-choix:hover { border-color: var(--trait-fort); background: var(--voile); }
.acc-choix-icone {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-moyen);
  background: color-mix(in srgb, var(--univers, var(--petrole)) 16%, transparent);
  color: var(--univers, var(--petrole));
}
.acc-choix-icone svg { width: 19px; height: 19px; }
.acc-choix-texte { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.acc-choix-texte strong { font-weight: 500; font-size: var(--t-base); color: var(--encre); }
.acc-choix-texte span { font-size: var(--t-s); color: var(--gris); }
.acc-choix-etat {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: var(--t-s);
  font-weight: 500;
  color: var(--petrole);
  white-space: nowrap;
}
.acc-choix-etat svg { width: 14px; height: 14px; }
/* Ajouté : le contour et la mention « Ajouté » suffisent, plus de bande
   orange à gauche (audit design du 10/11/2026). */
.acc-choix.est-ajoute { border-color: var(--petrole); background: var(--voile); }
.acc-choix.est-ajoute .acc-choix-icone { background: var(--univers, var(--petrole)); color: var(--sur-accent); }
.acc-choix.est-ajoute .acc-choix-etat { color: var(--ok-encre); }
.acc-choix:disabled { opacity: .6; cursor: wait; }

@media (hover: none) {
  .acc-retirer { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .acc-raccourci:hover .fleche { transform: none; }
}

/* L'accueil vide tient toute la largeur, pas la première colonne. */
#widgets-grid > .vide { grid-column: 1 / -1; }
