/* Système de design de CenterERP (U1) : palette, typographie, boutons, cartes, tableaux,
   champs, menus et fenêtres harmonisés sur tout le portail (accueil, paramétrage, pages des
   modules). Chargé après theme.css par shell/squelette.html : il a le dernier mot.

   Identité : accent indigo « CenterERP », neutres ardoise, états sémantiques (succès,
   attention, danger). La couleur de l'en-tête reste celle choisie par l'organisation.
   Aucune règle ici ne change un comportement : seulement l'apparence. */

:root {
  /* Accent */
  --encre: #3A4FD6;
  --encre-fonce: #2C3DB0;
  --encre-presse: #24328F;
  --seyes: #EEF1FD;
  --seyes-fort: #C9D1F8;
  /* Neutres */
  --papier: #F4F5F9;
  --texte: #1B2233;
  --texte-doux: #5C667A;
  --bordure: #E3E6EE;
  --bordure-champ: #C5CAD6;
  --survol: #EEF0F5;
  /* États */
  --succes: #177A48;
  --succes-fond: #E6F5EC;
  --succes-bordure: #BFE5CE;
  --attention: #9A5B00;
  --attention-fond: #FFF4DE;
  --attention-bordure: #F5DDA8;
  --danger: #C0362C;
  --danger-fonce: #9F2A22;
  --danger-fond: #FDECEA;
  --danger-bordure: #F5C6C1;
  --info: var(--encre);
  --info-fond: var(--seyes);
  /* Formes */
  --rayon: 12px;
  --rayon-champ: 8px;
  --ombre-1: 0 1px 2px rgb(27 34 51 / 0.05), 0 1px 3px rgb(27 34 51 / 0.06);
  --ombre-2: 0 2px 6px rgb(27 34 51 / 0.06), 0 10px 24px rgb(27 34 51 / 0.10);
  --ombre-3: 0 4px 10px rgb(27 34 51 / 0.08), 0 20px 44px rgb(27 34 51 / 0.16);
  --anneau: 0 0 0 3px rgb(58 79 214 / 0.28);
}

body { color: var(--texte); background: var(--papier); }

::selection { background: var(--seyes-fort); }

/* --- Typographie : une hiérarchie nette ------------------------------------------------- */

h1 { font-size: 1.375rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
h2 { font-size: 1.0625rem; font-weight: 700; line-height: 1.3; }
h3 { font-size: 0.9375rem; font-weight: 600; line-height: 1.35; }
.aide { color: var(--texte-doux); font-size: 0.875rem; line-height: 1.55; }
a { color: var(--encre); }

/* --- Boutons : principal, secondaire, discret, succès, danger ; états cohérents --------- */

.bouton,
.bouton-secondaire {
  display: inline-flex;
  gap: 0.4375rem;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.375rem 0.9375rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  border-radius: var(--rayon-champ);
  cursor: pointer;
  transition:
    background-color var(--duree) var(--courbe),
    border-color var(--duree) var(--courbe),
    box-shadow var(--duree) var(--courbe),
    color var(--duree) var(--courbe);
}

.bouton {
  color: #FFFFFF;
  background: var(--encre);
  border: 1px solid transparent;
  box-shadow: 0 1px 2px rgb(44 61 176 / 0.25);
}

.bouton:hover { background: var(--encre-fonce); transform: none; }
.bouton:active { background: var(--encre-presse); box-shadow: none; transform: none; }

.bouton.bouton-secondaire,
.bouton-secondaire {
  color: var(--texte);
  background: var(--blanc);
  border: 1px solid var(--bordure-champ);
  box-shadow: 0 1px 1px rgb(27 34 51 / 0.04);
}

.bouton.bouton-secondaire:hover,
.bouton-secondaire:hover {
  color: var(--encre-fonce);
  background: var(--seyes);
  border-color: var(--encre);
}

.bouton.bouton-secondaire:active,
.bouton-secondaire:active { background: var(--seyes-fort); }

.bouton.bouton-succes { background: var(--succes); box-shadow: 0 1px 2px rgb(23 122 72 / 0.25); }
.bouton.bouton-succes:hover { background: #126239; }
.bouton.bouton-succes:active { background: #0E4E2D; }

.bouton.bouton-danger { background: var(--danger); box-shadow: 0 1px 2px rgb(192 54 44 / 0.25); }
.bouton.bouton-danger:hover { background: var(--danger-fonce); }
.bouton.bouton-danger:active { background: #7F201A; }

/* Danger « doux » : action de refus à côté d'une action principale. */
.bouton.bouton-danger-doux {
  color: var(--danger);
  background: var(--blanc);
  border-color: var(--danger-bordure);
  box-shadow: none;
}
.bouton.bouton-danger-doux:hover { color: var(--danger-fonce); background: var(--danger-fond); border-color: var(--danger); }

.bouton-petit,
.bouton.bouton-petit,
.bouton-secondaire.bouton-petit {
  min-height: 1.875rem;
  padding: 0.1875rem 0.6875rem;
  font-size: 0.8125rem;
}

.bouton:focus-visible,
.bouton-secondaire:focus-visible { outline: none; box-shadow: var(--anneau); }

:is(.bouton, .bouton-secondaire):is(:disabled, [aria-disabled="true"]) {
  opacity: 0.5;
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}

.bouton.en-cours { cursor: progress; pointer-events: none; }

.bouton svg,
.bouton-secondaire svg { flex: none; }

/* Liens d'action des tableaux et « Annuler » des formulaires */
.actions a,
.actions .lien-bouton,
.carte-org-actions a,
.actions-formulaire > a { color: var(--encre); border-radius: 6px; }

.actions-formulaire > a { color: var(--texte-doux); }
.actions-formulaire > a:hover { color: var(--texte); background: var(--survol); }

/* --- Champs ------------------------------------------------------------------------------ */

.champ label,
.champ-libelle {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--texte);
}

.champ :is(
  input:not([type="checkbox"], [type="radio"], [type="file"], [type="color"], [type="hidden"], [type="range"]),
  select,
  textarea
) {
  min-height: 2.375rem;
  border-color: var(--bordure-champ);
  border-radius: var(--rayon-champ);
}

.champ :is(input:not([type="checkbox"], [type="radio"], [type="file"], [type="color"]), select) {
  block-size: 2.375rem;
}

.champ :is(input, select, textarea):hover:not(:disabled) { border-color: #9AA3B8; }

.champ :is(input, select, textarea):focus-visible {
  border-color: var(--encre);
  box-shadow: var(--anneau);
}

.champ :is(input, textarea)::placeholder { color: #9AA3B8; }

.champ-aide { color: var(--texte-doux); font-size: 0.8125rem; }

input[type="checkbox"],
input[type="radio"] { accent-color: var(--encre); }

/* Consultation : valeur lisible, sans cadre */
form[data-mode="lecture"] .champ :is(input, select, textarea):disabled {
  background: #F7F8FB;
  border-color: var(--bordure);
}

/* --- Cartes et panneaux ----------------------------------------------------------------- */

.bloc,
.parametrage-nav,
.parametrage-contenu {
  background: var(--blanc);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-1);
}

/* Carte générique utilisable par les modules. */
.carte {
  padding: 1.25rem;
  background: var(--blanc);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-1);
}

.carte + .carte { margin-block-start: 1rem; }

.carte-titre {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 700;
}

/* --- Tableaux --------------------------------------------------------------------------- */

.tableau-defilant,
.liste-modules,
.fiche { border-color: var(--bordure); border-radius: var(--rayon); }

.tableau th,
.parametrage-contenu .tableau th {
  padding: 0.625rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--texte-doux);
  background: #F8F9FC;
  border-bottom: 1px solid var(--bordure);
}

.tableau td {
  padding: 0.6875rem 0.875rem;
  font-size: 0.875rem;
  border-bottom-color: var(--bordure);
}

.tableau tbody tr { transition: background-color var(--duree) var(--courbe); }
.tableau tbody tr:hover { background: #F7F8FC; }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau tbody tr[data-lien]:hover .lien-ligne { color: var(--encre); text-decoration: none; }

/* --- Badges d'état : pastilles sémantiques ---------------------------------------------- */

.badge {
  display: inline-flex;
  gap: 0.3125rem;
  align-items: center;
  padding: 0.125rem 0.5625rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 999px;
}

/* --- Menus déroulants, fenêtres ---------------------------------------------------------- */

.menu-actions-liste,
.profil-panneau,
.cloche-panneau {
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-3);
}

.menu-actions-liste { padding: 0.375rem; }
.menu-actions-liste a { padding: 0.5rem 0.625rem; border-radius: 6px; }
.menu-actions-liste a:hover { background: var(--seyes); color: var(--encre-fonce); }

dialog {
  border: 1px solid var(--bordure);
  border-radius: 16px;
  box-shadow: var(--ombre-3);
}

dialog::backdrop { background: rgb(27 34 51 / 0.45); backdrop-filter: blur(2px); }

/* --- En-tête : icônes ---------------------------------------------------------------------- */

.entete-icone { border-radius: 10px; transition: background-color var(--duree) var(--courbe); }

.pastille {
  min-inline-size: 1.125rem;
  block-size: 1.125rem;
  padding-inline: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.125rem;
  background: #E5484D;
  border: 0;
  box-shadow: 0 0 0 2px rgb(0 0 0 / 0.18);
}

/* --- Barre des domaines / de l'application -------------------------------------------------- */

.barre-domaines { border-block-end-color: var(--bordure); box-shadow: 0 1px 2px rgb(27 34 51 / 0.03); }
.barre-domaines ul { max-width: 80rem; padding: 0 2rem; }
.barre-domaines li:first-child a { padding-inline-start: 0; }
.barre-domaines li:first-child a::after { inset-inline-start: 0; }
.barre-domaines a[aria-current="page"] { color: var(--encre); }
.barre-domaines a[aria-current="page"]::after { background: var(--encre); }

.barre-app .barre-app-retour {
  inline-size: 2rem;
  min-height: 2rem;
  margin-block: 0.375rem;
  padding: 0;
  justify-content: center;
  color: var(--texte-doux);
  border-radius: 8px;
  transition: background-color var(--duree) var(--courbe), color var(--duree) var(--courbe);
}
.barre-app .barre-app-retour:hover { color: var(--encre); background: var(--seyes); }
.barre-app li:first-child { padding-inline-end: 0.625rem; }
.barre-app-nom { font-size: 0.9375rem; font-weight: 700; color: var(--texte); }

/* --- Pages d'application : fond uni, contenu aligné sur la barre ---------------------------- */

.contenu-app {
  padding: 1.5rem 2rem 3rem;
  background: var(--papier);
}

.contenu-app > :not(.notifications) { max-width: 76rem; }

/* --- Accueil -------------------------------------------------------------------------------- */

.bienvenue { border-radius: 16px; box-shadow: var(--ombre-2); }

.portail-section {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--texte-doux);
}

.tuile {
  border: 1px solid var(--bordure);
  border-radius: 14px;
  box-shadow: var(--ombre-1);
  transition:
    transform var(--duree) var(--courbe),
    box-shadow var(--duree) var(--courbe),
    border-color var(--duree) var(--courbe);
}

.tuile:hover { border-color: var(--seyes-fort); box-shadow: var(--ombre-2); transform: translateY(-2px); }
.tuile:active { transform: translateY(0); box-shadow: var(--ombre-1); }
.tuile:focus-visible { outline: none; box-shadow: var(--anneau); }
.tuile-nom { font-size: 0.9375rem; font-weight: 600; }

/* --- Paramétrage ---------------------------------------------------------------------------- */

.parametrage-nav a { border-radius: 8px; }
.parametrage-nav a:hover { background: var(--survol); }
.parametrage-nav a[aria-current="page"] {
  font-weight: 600;
  color: var(--encre-fonce);
  background: var(--seyes);
}
.parametrage-contenu h1 { margin-block-end: 0.5rem; }

/* --- Messages flottants ---------------------------------------------------------------------- */

.notification { border-radius: 12px; box-shadow: var(--ombre-3); }

/* --- Cloche : panneau des notifications (U2) ------------------------------------------------- */

.cloche-panneau {
  inline-size: min(25rem, calc(100vw - 1rem));
  padding: 0;
  overflow: hidden;
}

.cloche-entete {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem 0.625rem;
}

.cloche-titre { margin: 0; padding: 0; font-size: 1rem; font-weight: 700; border: 0; }

.cloche-compte {
  margin-inline-start: 0.375rem;
  padding: 0.0625rem 0.4375rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--encre-fonce);
  background: var(--seyes);
  border-radius: 999px;
}

.cloche-lire {
  padding: 0.25rem 0.5rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--encre);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.cloche-lire:hover { background: var(--seyes); }

.cloche-filtres {
  display: flex;
  gap: 0.25rem;
  padding: 0 1rem 0.625rem;
  border-block-end: 1px solid var(--bordure);
}

.cloche-filtre {
  padding: 0.25rem 0.75rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--texte-doux);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
}
.cloche-filtre:hover { background: var(--survol); }
.cloche-filtre[aria-pressed="true"] { color: var(--encre-fonce); background: var(--seyes); border-color: var(--seyes-fort); }

.cloche-liste { max-height: min(28rem, calc(100vh - 12rem)); overflow-y: auto; }
.cloche-panneau[data-filtre="non_lues"] .cloche-avis:not(.non-lue) { display: none; }

.cloche-avis + .cloche-avis { border-block-start: 1px solid var(--bordure); }

.cloche-avis a {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) 0.5rem;
  gap: 0.125rem 0.75rem;
  align-items: start;
  padding: 0.75rem 1rem;
  color: var(--texte);
  text-decoration: none;
}
.cloche-avis a:hover { background: #F7F8FC; }
.cloche-avis.non-lue a { background: #FAFBFF; }
.cloche-avis.non-lue a:hover { background: var(--seyes); }
.cloche-avis.non-lue a::before { content: none; }

.cloche-avis-icone {
  display: grid;
  grid-row: 1 / span 3;
  inline-size: 2.25rem;
  block-size: 2.25rem;
  place-items: center;
  color: var(--encre);
  background: var(--seyes);
  border-radius: 10px;
}
.niveau-succes .cloche-avis-icone { color: var(--succes); background: var(--succes-fond); }
.niveau-alerte .cloche-avis-icone { color: var(--danger); background: var(--danger-fond); }

.cloche-avis-titre { grid-column: 2; font-size: 0.875rem; font-weight: 500; line-height: 1.35; }
.cloche-avis.non-lue .cloche-avis-titre { font-weight: 700; }
.cloche-avis.niveau-alerte .cloche-avis-titre { color: var(--texte); }
.cloche-avis-texte { grid-column: 2; font-size: 0.8125rem; line-height: 1.45; color: var(--texte-doux); }
.cloche-avis-date { grid-column: 2; margin-block-start: 0.125rem; font-size: 0.75rem; color: #8A93A6; }

.cloche-avis-point {
  grid-row: 1;
  grid-column: 3;
  inline-size: 0.5rem;
  block-size: 0.5rem;
  margin-block-start: 0.4375rem;
  background: var(--encre);
  border-radius: 50%;
}
.cloche-avis:not(.non-lue) .cloche-avis-point { visibility: hidden; }

.cloche-vide {
  display: grid;
  gap: 0.5rem;
  justify-items: center;
  margin: 0;
  padding: 2.25rem 1rem;
  font-size: 0.875rem;
  color: var(--texte-doux);
}
.cloche-vide svg { color: #B4BBCB; }
.cloche-vide-filtre { display: none; }
.cloche-panneau[data-filtre="non_lues"]:not(:has(.cloche-avis.non-lue)) .cloche-vide-filtre { display: grid; }

/* --- Petits écrans --------------------------------------------------------------------------- */

@media (max-width: 48rem) {
  .contenu-app { padding: 1rem 1rem 2rem; }
  .barre-domaines ul { padding: 0 1rem; }
  .bouton, .bouton-secondaire { min-height: 2.5rem; }
}

/* === U4 : passe écran par écran ============================================================= */

/* --- Pages du compte (mot de passe, préférences, notifications, recherche) : même colonne
       que l'accueil et les applications, au lieu d'un contenu collé au bord gauche. ---------- */

.contenu:not(.contenu-app, .contenu-parametrage, .contenu-portail) {
  padding-inline: max(2rem, calc((100% - 76rem) / 2));
}

/* --- Connexion : quadrillage fin et discret (choix « Cahier quadrillé »), carte nette -------- */

.page-connexion:not(.fond-couleur, .fond-image) {
  background-color: #F4F5F9;
  background-image:
    radial-gradient(ellipse 60% 55% at 50% 45%, #F4F5F9 0%, rgb(244 245 249 / 0) 100%),
    linear-gradient(to right, rgb(58 79 214 / 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(58 79 214 / 0.07) 1px, transparent 1px);
  background-size: auto, 32px 32px, 32px 32px;
  background-position: center, center, center;
  background-repeat: no-repeat, repeat, repeat;
}

.apercu-connexion:not(.fond-couleur, .fond-image) {
  background-color: #F4F5F9;
  background-image:
    linear-gradient(to right, rgb(58 79 214 / 0.10) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(58 79 214 / 0.10) 1px, transparent 1px);
  background-size: 16px 16px, 16px 16px;
  background-position: center, center;
  background-repeat: repeat, repeat;
}

.connexion {
  padding: 2rem 2rem 1.75rem;
  border: 1px solid var(--bordure);
  border-radius: 18px;
  box-shadow: var(--ombre-3);
}

.connexion-marque { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
.connexion-intro { color: var(--texte-doux); font-size: 0.9375rem; }
.connexion label { font-size: 0.8125rem; font-weight: 600; color: var(--texte); }
.connexion input { min-height: 2.625rem; border-radius: var(--rayon-champ); }
.connexion input:focus-visible { border-color: var(--encre); box-shadow: var(--anneau); }
.connexion .bouton { inline-size: 100%; min-height: 2.625rem; font-size: 0.9375rem; }
.connexion-lien a { font-weight: 600; text-decoration: none; }
.connexion-lien a:hover { text-decoration: underline; }

/* --- Actions destructrices d'une ligne de tableau : discrètes (contour), pleines au survol --- */

.tableau td .bouton.bouton-danger {
  color: var(--danger);
  background: var(--blanc);
  border-color: var(--danger-bordure);
  box-shadow: none;
}

.tableau td .bouton.bouton-danger:hover {
  color: #FFFFFF;
  background: var(--danger);
  border-color: var(--danger);
}

/* --- Blocs de formulaire (fieldset) et légendes ---------------------------------------------- */

fieldset.bloc > legend,
.bloc > legend { padding-inline: 0.5rem; font-size: 0.9375rem; font-weight: 700; color: var(--texte); }

/* --- Filtres en pastilles (journaux, modules, notifications) --------------------------------- */

.filtres a,
.filtres button { border-radius: 999px; }

/* === U5 : tuiles des applications — carré blanc et logo en couleurs ========================= */
/* Chaque application : un carré blanc simple (bordure fine, ombre légère) qui porte le logo
   du module avec ses propres couleurs (image SVG, plus un masque d'une seule couleur), et le
   libellé dessous. Grille resserrée. */

.tuile-icone {
  background: var(--icone) center / contain no-repeat;
  mask: none;
  opacity: 1;
}

.tuiles { gap: 0.625rem 0.125rem; }
.tuiles > li { width: calc(var(--taille-tuile) * 0.7); }

.tuiles .tuile,
.tuiles .tuile:hover,
.tuiles .tuile:active {
  gap: 0.5rem;
  justify-content: flex-start;
  height: auto;
  min-height: 0;
  aspect-ratio: auto;
  padding: 0.375rem 0.25rem;
  color: var(--texte);
  background: transparent;
  border: 0;
  border-radius: 14px;
  box-shadow: none;
  transform: none;
}

.tuiles .tuile::before,
.tuiles .tuile::after { content: none; }

.tuile-badge {
  display: grid;
  flex: none;
  inline-size: calc(var(--taille-tuile, 9.5rem) * 0.5);
  block-size: calc(var(--taille-tuile, 9.5rem) * 0.5);
  place-items: center;
  color: var(--texte-doux);
  background: var(--blanc);
  border: 1px solid var(--bordure);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgb(27 34 51 / 0.05);
  transition:
    transform var(--duree) var(--courbe),
    box-shadow var(--duree) var(--courbe),
    border-color var(--duree) var(--courbe);
}

.tuile-badge .tuile-icone { inline-size: 58%; block-size: 58%; }
.tuile-lettre { font-size: 1.5rem; font-weight: 700; color: var(--encre); }

.tuiles .tuile:hover .tuile-badge {
  border-color: var(--seyes-fort);
  box-shadow: 0 4px 10px rgb(27 34 51 / 0.08);
  transform: translateY(-2px);
}

.tuiles .tuile:active .tuile-badge { transform: translateY(0); }
.tuiles .tuile:focus-visible { outline: none; }
.tuiles .tuile:focus-visible .tuile-badge { box-shadow: var(--anneau); }

.tuiles .tuile-nom { font-size: 0.875rem; font-weight: 600; line-height: 1.3; color: var(--texte); }
.tuiles .tuile:hover .tuile-nom { color: var(--encre-fonce); }

/* === U6 : barres de défilement ================================================================ */
/* La barre de défilement de la page n'est plus affichée (la page défile toujours à la molette,
   au clavier et au doigt). Les zones internes qui défilent (panneau des notifications, liste
   des tâches, tableaux larges) gardent une barre fine et discrète, pour rester repérables. */

* { scrollbar-width: thin; scrollbar-color: #C5CAD6 transparent; }

html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }

/* === U7 : liste des modules en cartes ========================================================= */

.cartes-modules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr));
  gap: 1rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

.carte-module {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding: 1.125rem 1.25rem 1rem;
  overflow: hidden;
  background: var(--blanc);
  border: 1px solid var(--bordure);
  border-radius: 14px;
  box-shadow: var(--ombre-1);
  transition: box-shadow var(--duree) var(--courbe), border-color var(--duree) var(--courbe);
}

.carte-module:hover { border-color: var(--seyes-fort); box-shadow: var(--ombre-2); }

/* Liseré du haut : indigo pour Standard, or pour Premium. */
.carte-module::before {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 3px;
  content: "";
  background: var(--encre);
}

.carte-module-premium::before { background: linear-gradient(90deg, #B7791F, #F0B429, #B7791F); }
.carte-module-premium { border-color: #F0DDAF; }
.carte-module-premium:hover { border-color: #E3BD63; }
.carte-module-anomalie::before { background: var(--danger); }

.carte-module-entete { display: flex; gap: 0.875rem; align-items: center; }

.carte-module-logo {
  display: grid;
  flex: none;
  inline-size: 3.25rem;
  block-size: 3.25rem;
  place-items: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--encre);
  background: #F8F9FC;
  border: 1px solid var(--bordure);
  border-radius: 12px;
}

.carte-module-premium .carte-module-logo { background: #FFFAEB; border-color: #F0DDAF; }

.carte-module-titres { flex: 1; min-inline-size: 0; }
.carte-module-nom { margin: 0; font-size: 1.0625rem; font-weight: 700; line-height: 1.3; color: var(--texte); }
.carte-module-code { margin: 0.125rem 0 0; font-size: 0.8125rem; color: var(--texte-doux); }

.carte-module-corps:empty { display: none; }
.carte-module-meta { margin: 0; font-size: 0.8125rem; line-height: 1.5; color: var(--texte-doux); }
.carte-module-erreur {
  margin: 0.25rem 0 0;
  padding: 0.5rem 0.625rem;
  font-size: 0.8125rem;
  color: var(--danger);
  background: var(--danger-fond);
  border-radius: 8px;
}

.carte-module-pied {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-block-start: auto;
  padding-block-start: 0.875rem;
  border-block-start: 1px solid var(--bordure);
}

/* État : point de couleur + libellé. */
.etat-module {
  display: inline-flex;
  gap: 0.4375rem;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--texte-doux);
}

.etat-module::before {
  inline-size: 0.5rem;
  block-size: 0.5rem;
  content: "";
  background: #B4BBCB;
  border-radius: 50%;
}

.etat-installe { color: var(--succes); }
.etat-installe::before { background: var(--succes); box-shadow: 0 0 0 3px var(--succes-fond); }
.etat-disponible { color: var(--encre-fonce); }
.etat-disponible::before { background: var(--encre); box-shadow: 0 0 0 3px var(--seyes); }
.etat-attention { color: var(--attention); }
.etat-attention::before { background: #E08A00; box-shadow: 0 0 0 3px var(--attention-fond); }

/* Badges d'édition */
.badge-standard { color: var(--encre-fonce); background: var(--seyes); border-color: var(--seyes-fort); }
.badge-premium {
  color: #7A4A00;
  background: linear-gradient(135deg, #FFF4D6, #FCE3A1);
  border-color: #E9C46A;
}

/* --- Accueil : tâches à traiter (U9) --------------------------------------------------------- */
/* Cartes compactes ; la carte entière ouvre la tâche (lien étiré), les boutons restent au-dessus. */

.taches-compte {
  display: inline-grid;
  min-inline-size: 1.375rem;
  padding-inline: 0.375rem;
  margin-inline-start: 0.25rem;
  font-size: 0.75rem;
  line-height: 1.375rem;
  color: var(--blanc, #fff);
  letter-spacing: 0;
  vertical-align: middle;
  background: var(--encre);
  border-radius: 999px;
  place-items: center;
}

.taches-accueil {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
  gap: 0.875rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tache-carte {
  position: relative;
  display: grid;
  gap: 0.625rem;
  align-content: start;
  padding: 0.875rem;
  background: #FFFFFF;
  border: 1px solid #E3E6EE;
  border-radius: 14px;
  box-shadow: var(--ombre-1);
  transition: border-color var(--duree) var(--courbe), box-shadow var(--duree) var(--courbe), transform var(--duree) var(--courbe);
}

.tache-carte:hover { border-color: #C9D0F5; box-shadow: var(--ombre-2); transform: translateY(-2px); }
.tache-carte:focus-within { border-color: var(--encre); }

.tache-entete { display: flex; gap: 0.625rem; align-items: center; min-inline-size: 0; }

.tache-avatar {
  display: inline-grid;
  flex: none;
  inline-size: 2.25rem;
  block-size: 2.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--encre-fonce);
  background: #E9ECFB;
  border-radius: 50%;
  place-items: center;
}

.tache-titres { display: grid; flex: 1; min-inline-size: 0; line-height: 1.3; }

.tache-titre {
  overflow: hidden;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1B2233;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Lien étiré : toute la carte est cliquable. */
.tache-titre::after { position: absolute; inset: 0; content: ""; border-radius: 14px; }
.tache-titre:focus-visible { outline: 0; }
.tache-titre:focus-visible::after { outline: var(--anneau, 2px solid var(--encre)); outline-offset: 2px; }

.tache-sous-titre { overflow: hidden; font-size: 0.8125rem; color: #5B667A; text-overflow: ellipsis; white-space: nowrap; }

.tache-etat {
  flex: none;
  padding: 0.125rem 0.5625rem;
  font-size: 0.7188rem;
  font-weight: 600;
  color: #8A5A00;
  background: #FFF1CC;
  border-radius: 999px;
}

.tache-lignes { display: grid; margin: 0; border: 1px solid #ECEEF4; border-radius: 10px; }
.tache-lignes div { display: flex; gap: 0.75rem; justify-content: space-between; padding: 0.375rem 0.625rem; font-size: 0.8125rem; }
.tache-lignes div + div { border-block-start: 1px solid #ECEEF4; }
.tache-lignes dt { color: #5B667A; }
.tache-lignes dd { margin: 0; font-weight: 600; color: #1B2233; text-align: end; }

.tache-actions { position: relative; z-index: 1; display: flex; gap: 0.5rem; justify-content: flex-end; }
.tache-actions form { margin: 0; }

.tache-bouton {
  padding: 0.3125rem 0.875rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #38425A;
  cursor: pointer;
  background: #EEF0F5;
  border: 0;
  border-radius: 999px;
  transition: filter var(--duree) var(--courbe);
}

.tache-bouton:hover { filter: brightness(0.94); }
.tache-bouton-accord { color: #FFFFFF; background: #17A15B; }
.tache-bouton-refus { color: #B3363B; background: #FFE7E7; }
.taches-suite { margin-block: 0.75rem 0; font-size: 0.875rem; color: #5B667A; }

/* === Core 1.9.0 : style de tuiles « Sobre » (corporate, minimaliste) ======================== */
/* Choisi dans Paramétrage > Réglages du portail > Apparence des tuiles. Une seule librairie
   d'icônes (Lucide, trait de 2 px, sprite local shell/icones/lucide.svg), d'une seule couleur :
   celle de la tuile (couleur de marque par défaut ; une ou deux couleurs secondaires se règlent
   tuile par tuile). Toutes les tuiles : même fond, rayon de 12 px, même ombre légère ; libellé
   sur une ligne ; au survol, la carte se soulève, l'ombre se creuse, la pastille prend la
   couleur de la tuile. Sans symbole déclaré par le module : son image, d'une seule couleur. */

.tuile-symbole { display: none; }

.tuiles-sobre { gap: 0.875rem; }
.tuiles-sobre > li { width: calc(var(--taille-tuile) * 0.82); }

.tuiles-sobre .tuile,
.tuiles-sobre .tuile:hover,
.tuiles-sobre .tuile:active {
  position: relative;
  gap: 0.625rem;
  justify-content: flex-start;
  align-items: center;
  padding: 1rem 0.625rem 0.875rem;
  color: var(--texte);
  background: #FFFFFF;
  border: 1px solid #E6E8EC;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transform: none;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.tuiles-sobre .tuile:hover {
  background: color-mix(in srgb, var(--tuile-couleur) 4%, #FFFFFF);
  border-color: color-mix(in srgb, var(--tuile-couleur) 35%, #E6E8EC);
  box-shadow: 0 10px 22px rgba(16, 24, 40, 0.10);
  transform: translateY(-3px) scale(1.02);
}

.tuiles-sobre .tuile:active { transform: translateY(-1px) scale(1.01); }

.tuiles-sobre .tuile:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tuile-couleur) 40%, transparent);
}

.tuiles-sobre .tuile-badge,
.tuiles-sobre .tuile:hover .tuile-badge {
  inline-size: 3rem;
  block-size: 3rem;
  color: var(--tuile-couleur);
  background: #F3F4F6;
  border: 0;
  border-radius: 12px;
  box-shadow: none;
  transform: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.tuiles-sobre .tuile:hover .tuile-badge { color: #FFFFFF; background: var(--tuile-couleur); }

.tuiles-sobre .tuile-symbole { display: block; inline-size: 1.5rem; block-size: 1.5rem; }
.tuiles-sobre .tuile-badge:has(.tuile-symbole) .tuile-icone { display: none; }

/* Sans symbole : l'image du module devient une silhouette d'une seule couleur. */
.tuiles-sobre .tuile-icone {
  inline-size: 1.625rem;
  block-size: 1.625rem;
  background: currentColor;
  mask: var(--icone) center / contain no-repeat;
}

.tuiles-sobre .tuile-lettre { font-size: 1.25rem; color: currentColor; }

.tuiles-sobre .tuile-nom,
.tuiles-sobre .tuile:hover .tuile-nom {
  max-inline-size: 100%;
  overflow: hidden;
  font-size: 0.8438rem;
  font-weight: 600;
  line-height: 1.3;
  color: #1F2937;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .tuiles-sobre .tuile,
  .tuiles-sobre .tuile:hover { transform: none; transition: none; }
}
