/* ==========================================================================
   F&I STUDIO — COMPOSANT : LIGNE D'ACTION (.fi-action-row)
   ==========================================================================
   Remplace .basketAction / .basketActionGroup .basketAction /
   .basketAction--status / #openEmailCenterButton (voir docs/UI_AUDIT.md et
   docs/DESIGN_SYSTEM.md, section « Ligne d'action »). Ce pattern a été
   identifié comme structurellement distinct de .fi-button pendant la
   migration de #clientWorkspace : une ligne de menu pleine largeur
   (icône à gauche, texte aligné à gauche, chevron à droite), pas un
   bouton centré à largeur automatique. Utiliser .fi-button pour une
   action-bouton classique ; .fi-action-row pour une ligne pleine largeur
   de type menu/liste avec icône + texte + chevron — jamais l'un à la
   place de l'autre selon la seule couleur.

   Structure :
   <div class="fi-action-row-group">
     <span class="fi-action-row-group__label eyebrow">Titre</span>
     <div class="fi-action-row-group__card">
       <button type="button" class="fi-action-row">
         <span class="fi-action-row__icon" aria-hidden="true"></span>
         <span class="fi-action-row__label">Texte</span>
         <span class="fi-chevron" aria-hidden="true"></span>
       </button>
     </div>
   </div>

   Variantes :
   .fi-action-row--primary  action mise en avant de la liste (fond plein,
                             ex. « Envoi de courriel »)
   .fi-action-row--status   ligne à 2 états sans icône de tête (ex. Livré /
                             Archivé) — pas de variante Button "success"
                             créée pour ce besoin, voir docs/DESIGN_SYSTEM.md

   SPÉCIFICITÉ — même piège que dans button.css (voir son en-tête) : ces
   boutons vivent tous dans <aside class="basket">, et `.basket button`
   (0,1,1) bat une classe simple `.fi-action-row` (0,1,0) sans même utiliser
   !important. Chaque sélecteur qui touche le <button> lui-même répète donc
   sa classe (`.fi-action-row.fi-action-row`) pour porter la spécificité à
   (0,2,0) — même technique de compatibilité temporaire que .fi-button, à
   simplifier plus tard une fois `.basket button` migré/retiré. Les
   sous-éléments (icône/texte/chevron, des <span>) ne sont jamais ciblés par
   `.basket button` : pas besoin de les doubler.

   Icônes : conserve la technique existante (fond teinté + background-image
   SVG data-URI par bouton, tons alignés sur les tokens --fi-chip-*-bg déjà
   extraits pour .fi-icon-chip) plutôt que de refaire le registre SVG de
   js/app.js dans cette étape — voir docs/UI_AUDIT.md §5.7.

   Chevron : réutilise .fi-chevron (css/components/icon.css) tel quel — pas
   de 4e technique de chevron. Exception : les 2 lignes --status ont leur
   texte réécrit directement en JS via .textContent sur un <span> dédié
   (voir js/app.js, updateDeliveredButtonUI/updateArchivedButtonUI) ; leur
   chevron est donc rendu en ::after avec les MÊMES valeurs que .fi-chevron
   (aucune nouvelle technique, juste une application différente de la même
   recette) puisqu'elles gardent une structure à un seul enfant texte.
   ========================================================================== */

.fi-action-row-group{
  display:flex;
  flex-direction:column;
  gap:var(--fi-space-2xs);
}

.fi-action-row-group__label{
  margin:var(--fi-space-xl) var(--fi-space-2xs) var(--fi-space-xs);
  font-family:var(--fi-font);
  font-size:var(--fi-text-xs);
  font-weight:var(--fi-weight-interactive);
  letter-spacing:var(--fi-tracking-wider);
  text-transform:uppercase;
  color:var(--fi-ink-faint);
}

.fi-action-row-group__card{
  display:flex;
  flex-direction:column;
  border:1px solid var(--fi-border);
  border-radius:var(--fi-radius-2xl);
  background:var(--fi-surface);
  box-shadow:var(--fi-shadow-sm);
  overflow:hidden;
}

.fi-action-row.fi-action-row{
  display:grid;
  grid-template-columns:32px minmax(0,1fr) auto;
  align-items:center;
  gap:var(--fi-space-md);
  width:100%;
  min-height:var(--fi-control-height-large);
  margin:0;
  padding:var(--fi-space-sm) var(--fi-space-lg);
  border:0;
  border-bottom:1px solid var(--fi-border-soft);
  border-radius:0;
  background:var(--fi-surface);
  color:var(--fi-ink);
  font-family:var(--fi-font);
  font-size:var(--fi-text-md);
  font-weight:var(--fi-weight-meta);
  text-align:left;
  cursor:pointer;
  transition:background-color .12s ease, color .12s ease;
}
.fi-action-row-group__card>.fi-action-row.fi-action-row:last-child{
  border-bottom:0;
}
.fi-action-row.fi-action-row:hover:not(:disabled){
  background:var(--fi-hover-surface);
}
.fi-action-row.fi-action-row:focus-visible{
  outline:none;
  box-shadow:inset 0 0 0 2px var(--fi-action-primary);
  z-index:1;
  position:relative;
}
.fi-action-row.fi-action-row:disabled,
.fi-action-row.fi-action-row[aria-disabled="true"]{
  cursor:not-allowed;
  opacity:.5;
}

.fi-action-row__icon{
  display:flex;
  align-items:center;
  justify-content:center;
  width:32px;
  height:32px;
  border-radius:var(--fi-radius-sm);
  background-repeat:no-repeat;
  background-position:center;
  background-size:17px 17px;
  font-size:15px;
  line-height:1;
}

.fi-action-row__label{
  min-width:0;
  overflow:visible;
  overflow-wrap:anywhere;
  text-overflow:clip;
  white-space:normal;
  line-height:var(--fi-leading-normal);
}

.fi-action-row .fi-chevron{
  color:var(--fi-ink-faint);
}

/* --- Primaire : action mise en avant de la liste (ex. Envoi de courriel) ---
   Intégrée aux cartes de la colonne (surface blanche, filet) : l'importance passe par
   la pastille d'icône marine et un libellé plus appuyé, jamais par un bandeau coloré. */
.fi-action-row.fi-action-row.fi-action-row--primary{
  border:1px solid var(--fi-border);
  border-radius:var(--fi-radius-2xl);
  background:var(--fi-surface);
  color:var(--fi-ink);
  font-weight:var(--fi-weight-heading);
}
.fi-action-row.fi-action-row.fi-action-row--primary:hover:not(:disabled){
  border-color:color-mix(in srgb, var(--fi-action-solid) 28%, var(--fi-border));
  background:var(--fi-surface-2);
}
/* Icône seule, sans pastille ni cadre : même enveloppe SVG que « Historique des courriels ».
   Le <span> est vide (plus de glyphe texte « ✉ », rendu en emoji couleur sous Windows). */
.fi-action-row--primary .fi-action-row__icon{
  border:0;
  border-radius:0;
  box-shadow:none;
  background-color:transparent;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23087cf0' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m4 7 8 6 8-6'/%3E%3C/svg%3E");
  color:transparent;
  font-size:0;
}
.fi-action-row--primary .fi-chevron{
  color:var(--fi-ink-soft);
}

/* --- Statut : ligne à 2 états, pas d'icône de tête (Livré / Archivé) ---
   Le contenu texte est réécrit par JS (voir en-tête de fichier) ; le
   chevron est donc en ::after ici, avec les mêmes valeurs que .fi-chevron. */
.fi-action-row.fi-action-row.fi-action-row--status{
  grid-template-columns:minmax(0,1fr) auto;
  font-weight:var(--fi-weight-heading);
}
.fi-action-row--status::after{
  content:"";
  display:inline-block;
  width:7px;
  height:7px;
  border-right:1.8px solid currentColor;
  border-top:1.8px solid currentColor;
  transform:rotate(45deg);
  color:var(--fi-ink-faint);
}
.fi-action-row.fi-action-row.fi-action-row--status.is-delivered{
  background:var(--fi-success-soft);
  color:var(--fi-success);
}
.fi-action-row--status.is-delivered::after{
  color:var(--fi-success);
}
.fi-action-row.fi-action-row.fi-action-row--status.is-archived{
  background:var(--fi-surface-2);
  color:var(--fi-ink-soft);
}
.fi-action-row--status.is-archived::after{
  color:var(--fi-ink-faint);
}

/* --- Icônes des lignes par défaut : fond teinté (tokens --fi-chip-*-bg) +
   glyphe SVG existant conservé tel quel (voir docs/UI_AUDIT.md §5.7). --- */
#openDealEmailHistoryButton .fi-action-row__icon{
  background-color:var(--fi-chip-blue-bg);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23087cf0' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m4 7 8 6 8-6'/%3E%3C/svg%3E");
}
#openDealHistoryButton .fi-action-row__icon{
  background-color:var(--fi-chip-purple-bg);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236559ef' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12a8 8 0 1 0 2.3-5.7L4 8.5M4 4v4.5h4.5'/%3E%3Cpath d='M12 8v5l3 2'/%3E%3C/svg%3E");
}
#openPrintDocumentsButton .fi-action-row__icon{
  background-color:var(--fi-chip-orange-bg);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e88600' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 8V4h10v4M7 17H5a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2M7 14h10v6H7Z'/%3E%3C/svg%3E");
}
#previewBrochureButton .fi-action-row__icon{
  background-color:var(--fi-chip-indigo-bg);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d67d8' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='18' rx='2'/%3E%3Cpath d='M8 8h8M8 12h8M8 16h5'/%3E%3C/svg%3E");
}
#openProductDecisionSheetButton .fi-action-row__icon{
  background-color:var(--fi-chip-green-bg);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23168844' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 5 6v5c0 4.4 2.7 7.7 7 10 4.3-2.3 7-5.6 7-10V6Z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
}
#openDealInvoicesButton .fi-action-row__icon{
  background-color:var(--fi-chip-pink-bg);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c23b5c' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3h10a1 1 0 0 1 1 1v17l-2.5-1.5L13 21l-2.5-1.5L8 21l-2.5-1.5L3 21V6a1 1 0 0 1 1-1h1'/%3E%3Cpath d='M9 8h6M9 12h6M9 16h3'/%3E%3C/svg%3E");
}
/* 2026-09-23 — même glyphe que #openGlobalCheckRequisitionsButton (Accueil > Outils, déjà
   correct) reconverti en icône fond-teinté+SVG (technique de ce fichier), jamais un nouveau
   dessin : cette occurrence dans le dossier client n'avait jamais reçu sa règle d'icône. */
#openCheckRequisitionButton .fi-action-row__icon{
  background-color:var(--fi-chip-green-bg);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23168844' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3.5h12v17H6z'/%3E%3Cpath d='m8.5 8 1.2 1.2L12 7M13.5 8H16m-7.5 5 1.2 1.2L12 12m1.5 1H16'/%3E%3C/svg%3E");
}
/* #openEmailCenterButton : icône portée par .fi-action-row--primary ci-dessus (SVG en fond). */
