/* =============================================================================================
   outils.css — Lot UX « Outils » (16/11/2026)

   La mise en place de la maquette 01, aux couleurs de MJP OS : « garde nos couleurs, je ne
   veux pas du violet ». Fonds blancs ou gris très clair ; la couleur ne va que sur le bouton
   principal de chaque carte, le filtre actif, les puces et les ronds d'icône. Bornée à la vue
   Outils, jetons de la charte seulement.
   ============================================================================================= */

/* --- Le bandeau pleine largeur --------------------------------------------------------------- */
#view-tools .ou-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}
#view-tools .ou-hero-icone {
  display: inline-grid; place-items: center;
  width: 64px; height: 64px; border-radius: 18px;
  background: color-mix(in srgb, var(--section) 30%, transparent);
  color: #fff;
}
#view-tools .ou-hero-icone .picto { width: 32px; height: 32px; }
#view-tools .ou-hero-texte h2 { margin: 0; }
#view-tools .ou-hero-texte p:last-child { margin: 4px 0 0; }
#view-tools .ou-hero-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
#view-tools .ou-hero-actions .button { display: inline-flex; align-items: center; gap: 8px; }
#view-tools .ou-hero-actions .picto { width: 18px; height: 18px; }
#view-tools kbd {
  padding: 1px 6px; border: 1px solid currentColor; border-radius: 6px;
  font-family: inherit; font-size: 0.74rem; font-weight: 800; opacity: 0.85;
}

/* --- Quatre chiffres ---------------------------------------------------------------------------- */
#view-tools .ou-chiffres {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 14px;
}
#view-tools .ou-chiffre {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-premium);
  box-shadow: var(--ombre-1);
}
#view-tools .ou-chiffre strong { font-size: 1.9rem; line-height: 1; font-weight: 880; }
#view-tools .ou-chiffre > span:last-child { grid-column: 2; color: var(--slate); font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
#view-tools .ou-chiffre-rond {
  grid-row: 1 / span 2;
  display: inline-grid; place-items: center;
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--blue-soft); color: var(--blue);
}
#view-tools .ou-chiffre-rond .picto { width: 24px; height: 24px; }
#view-tools .ou-chiffre[data-ton="vert"] .ou-chiffre-rond { background: var(--green-soft); color: var(--green); }
#view-tools .ou-chiffre[data-ton="ambre"] .ou-chiffre-rond { background: var(--amber-soft); color: var(--amber); }
#view-tools .ou-chiffre[data-ton="teal"] .ou-chiffre-rond { background: var(--teal-soft); color: var(--teal); }

/* --- Accès rapide ------------------------------------------------------------------------------ */
#view-tools .ou-acces {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding: 12px 16px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-premium);
}
#view-tools .ou-acces-titre { display: flex; align-items: center; gap: 10px; }
#view-tools .ou-acces-titre strong { display: block; font-size: 1rem; }
#view-tools .ou-acces-titre small { color: var(--slate); font-size: 0.78rem; }
#view-tools .ou-acces-rond { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); }
#view-tools .ou-acces-rond .picto { width: 20px; height: 20px; }
#view-tools .ou-acces-groupe { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-left: 18px; border-left: 1px solid var(--line); }
#view-tools .ou-acces-libelle { display: inline-flex; align-items: center; gap: 6px; font-weight: 850; }
#view-tools .ou-acces-libelle .picto { width: 18px; height: 18px; color: var(--amber); }
#view-tools .ou-acces-vide { color: var(--slate); font-size: 0.84rem; }
#view-tools .ou-pastille {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 38px; padding: 4px 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-premium); color: var(--ink);
  font-size: 0.84rem; font-weight: 750; cursor: pointer;
}
#view-tools .ou-pastille:hover { border-color: var(--section); }
#view-tools .ou-pastille-icone { display: inline-grid; place-items: center; width: 24px; height: 24px; color: var(--section); }
#view-tools .ou-pastille-icone svg { width: 20px; height: 20px; }
#view-tools .ou-pastille-etoile .picto { width: 15px; height: 15px; fill: var(--amber); color: var(--amber); }

/* --- Recherche, familles, tri ------------------------------------------------------------------ */
#view-tools .ou-barre { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
#view-tools .ou-recherche {
  display: flex; align-items: center; gap: 8px;
  flex: 0 1 300px; min-width: 220px;
  padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-pilule);
  background: var(--surface-premium);
}
#view-tools .ou-recherche > .picto { width: 18px; height: 18px; color: var(--muted); }
#view-tools .ou-recherche input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: none; font-size: 0.95rem; }
#view-tools .ou-recherche:focus-within { border-color: var(--section); }
#view-tools .ou-filtres { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 auto; }
#view-tools .ou-filtre {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-pilule);
  background: var(--surface-premium); color: var(--ink);
  font-size: 0.86rem; font-weight: 800; cursor: pointer;
}
#view-tools .ou-filtre .picto { width: 16px; height: 16px; }
#view-tools .ou-filtre.is-active { border-color: var(--section); background: var(--section); color: #fff; }
#view-tools .ou-trier { position: relative; }
#view-tools .ou-trier > summary {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-pilule);
  background: var(--surface-premium); font-size: 0.86rem; font-weight: 800; cursor: pointer; list-style: none;
}
#view-tools .ou-trier > summary::-webkit-details-marker { display: none; }
#view-tools .ou-trier > summary .picto { width: 16px; height: 16px; }
#view-tools .ou-trier-panneau {
  position: absolute; right: 0; z-index: 5; display: grid; gap: 8px; min-width: 230px;
  margin-top: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface-premium); box-shadow: var(--ombre-2);
}
#view-tools .ou-trier-panneau label { display: flex; align-items: center; gap: 8px; font-weight: 700; }

/* --- La grille de cartes : 5 par ligne en 1920 px ------------------------------------------- */
#view-tools .tool-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
#view-tools .tool-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-premium);
  box-shadow: var(--ombre-1);
}
#view-tools .tool-card:hover { box-shadow: var(--ombre-2); }
/* « Je ne veux pas du violet » : la Programmation garde sa teinte ailleurs, pas ici. */
#view-tools .tool-card[data-tool="programmation"] { --outil: var(--blue); }
/* Les aires de grille de la carte d'avant (styles.css) ne valent plus ici : la carte est une
   colonne, et son en-tête une grille à elle. */
#view-tools .tool-card > *,
#view-tools .ou-carte-tete > * { grid-area: auto; min-width: 0; max-width: 100%; }
#view-tools .ou-carte-tete { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 12px; min-width: 0; }
#view-tools .tool-card-icone {
  display: inline-grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: color-mix(in srgb, var(--outil, var(--section)) 14%, var(--surface-premium));
  color: var(--outil, var(--section));
}
#view-tools .tool-card-icone svg { width: 26px; height: 26px; }
#view-tools .tool-card-entete { display: grid; gap: 4px; justify-items: start; min-width: 0; }
#view-tools .tool-card-title { margin: 0; font-size: 1.02rem; line-height: 1.25; overflow-wrap: anywhere; }
#view-tools .tool-card-etat {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: var(--radius-pilule); font-size: 0.74rem; font-weight: 800;
}
#view-tools .tool-card-etat.est-disponible { background: var(--green-soft); color: var(--green); }
#view-tools .tool-card-etat.est-disponible::before { content: "✓"; }
#view-tools .tool-card-etat.est-indisponible { background: var(--surface-soft); color: var(--slate); }
#view-tools .ou-categorie {
  padding: 3px 10px; border-radius: var(--radius-pilule);
  background: var(--surface-soft); color: var(--slate);
  font-size: 0.72rem; font-weight: 850; white-space: nowrap;
}
#view-tools .ou-categorie[data-categorie="Terrain"] { background: var(--green-soft); color: var(--green); }
#view-tools .ou-categorie[data-categorie="Ressource"],
#view-tools .ou-categorie[data-categorie="Document"] { background: var(--blue-soft); color: var(--blue); }
#view-tools .ou-categorie[data-categorie="IA"],
#view-tools .ou-categorie[data-categorie="Analyse"] { background: var(--teal-soft); color: var(--teal); }
#view-tools .ou-categorie[data-categorie="Entraînement"] { background: var(--blue-soft); color: var(--navy); }
#view-tools .ou-categorie[data-categorie="Athlétique"] { background: var(--orange-soft); color: var(--orange); }
#view-tools .ou-categorie[data-categorie="Méthode"] { background: var(--amber-soft); color: var(--amber); }
#view-tools .tool-card-text {
  margin: 0; color: var(--slate); font-size: 0.88rem; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
#view-tools .tool-card-version {
  display: flex; align-items: center; gap: 6px; margin: 0;
  color: var(--muted); font-size: 0.8rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#view-tools .tool-card-version .picto { width: 15px; height: 15px; flex: none; }
#view-tools .ou-carte-pied { display: flex; align-items: center; gap: 10px; margin-top: auto; }
#view-tools .ou-carte-pied .tool-card-actions { flex: 1; margin: 0; }
#view-tools .ou-ouvrir {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 42px;
  border-color: var(--section); background: var(--section); color: #fff;
}
#view-tools .ou-ouvrir:hover { filter: brightness(1.06); }
#view-tools .ou-ouvrir .picto { width: 17px; height: 17px; }
#view-tools .ou-etoile {
  display: inline-grid; place-items: center; flex: none;
  width: 42px; height: 42px; margin-left: auto;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-premium); color: var(--slate); cursor: pointer;
}
#view-tools .ou-etoile .picto { width: 20px; height: 20px; }
#view-tools .ou-etoile.est-favori { border-color: var(--amber); color: var(--amber); }
#view-tools .ou-etoile.est-favori .picto { fill: var(--amber); }
#view-tools .tool-card.is-unavailable { background: var(--surface-soft); box-shadow: none; }
#view-tools .tool-card-maj { margin-top: 2px; }
#view-tools .ou-vide { grid-column: 1 / -1; display: grid; justify-items: center; gap: 8px; padding: 36px 16px; text-align: center; color: var(--slate); }
#view-tools .ou-vide p { margin: 0; }
#view-tools .ou-vide-rond { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); }
#view-tools .ou-vide-rond .picto { width: 30px; height: 30px; }

/* --- La recherche rapide (Ctrl K) -------------------------------------------------------------- */
#view-tools .ou-palette {
  width: min(560px, calc(100vw - 24px));
  margin-top: 12vh;
  padding: 14px;
  border: 0;
  border-radius: 18px;
  background: var(--surface-premium);
  box-shadow: var(--ombre-2);
}
#view-tools .ou-palette-champ { flex: none; width: 100%; max-width: none; }
#view-tools .ou-palette-liste { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; max-height: 50vh; overflow: auto; }
#view-tools .ou-palette-item {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px; cursor: pointer; font-weight: 750;
}
#view-tools .ou-palette-item small { color: var(--slate); font-weight: 700; }
#view-tools .ou-palette-item.is-choisi,
#view-tools .ou-palette-item:hover { background: var(--teal-soft); }
#view-tools .ou-palette-vide { padding: 12px; color: var(--slate); }
#view-tools .ou-palette-aide { margin: 10px 0 0; color: var(--slate); font-size: 0.8rem; }

#view-tools :is(.ou-filtre, .ou-pastille, .ou-etoile, .ou-ouvrir, .ou-trier > summary, .ou-hero-actions .button):focus-visible {
  outline: 3px solid var(--section); outline-offset: 2px;
}

@media (max-width: 1100px) {
  #view-tools .ou-hero { grid-template-columns: auto minmax(0, 1fr); }
  #view-tools .ou-hero-actions { grid-column: 1 / -1; justify-content: flex-start; }
  #view-tools .ou-chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #view-tools .ou-acces-groupe { padding-left: 0; border-left: 0; }
}
@media (max-width: 620px) {
  #view-tools .ou-hero { grid-template-columns: minmax(0, 1fr); }
  #view-tools .ou-hero-icone { display: none; }
  #view-tools .ou-hero-actions .button { flex: 1 1 100%; justify-content: center; }
  #view-tools .ou-chiffres { gap: 8px; }
  #view-tools .ou-chiffre { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 12px 8px; row-gap: 4px; }
  #view-tools .ou-chiffre-rond { grid-row: auto; width: 38px; height: 38px; }
  #view-tools .ou-chiffre strong { font-size: 1.45rem; }
  #view-tools .ou-chiffre > span:last-child { grid-column: auto; font-size: 0.66rem; }
  #view-tools .ou-recherche { flex: 1 1 100%; }
  #view-tools .ou-filtres { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  #view-tools .ou-filtre { flex: none; }
  #view-tools .tool-grid { grid-template-columns: minmax(0, 1fr); }
}
