/* ============================================================================
   T8a — FICHE ARTICLE PLEIN ÉCRAN (spec : docs/maquettes/fiche_article.html)
   ----------------------------------------------------------------------------
   TOUS les sélecteurs sont bornés à .artfiche (elle-même portée par un wrapper
   .docv2 pour hériter des tokens --dgs-*) → aucun autre écran n'est affecté,
   y compris ceux qui utilisent déjà .docv2 (bon de livraison, factures…).
   On ne touche NI app.css NI doc-v2.css : habillage additif seul.
   ============================================================================ */

.docv2.artfiche { max-width: 1400px; margin: 0 auto; padding: 0 0 24px; }

/* ---------------- bandeau ---------------- */
.artfiche .art-hd {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  background: var(--dgs-surface); border: 1px solid var(--dgs-bordure);
  border-radius: var(--r-lg); padding: 12px 16px; margin-bottom: 10px;
  box-shadow: var(--sh-sm);
}
.artfiche .art-fil { font-size: 11.5px; color: var(--dgs-texte-3); margin-bottom: 4px; }
.artfiche .art-fil a { color: var(--dgs-texte-2); text-decoration: none; }
.artfiche .art-fil a:hover { color: var(--dgs-vert); }
.artfiche .art-titre-ligne { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.artfiche .art-titre { font-size: 20px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.artfiche .art-ref-chip {
  font-size: 12px; font-weight: 500; color: var(--dgs-texte-2); background: var(--dgs-muted);
  border: 1px solid var(--dgs-bordure); border-radius: 8px; padding: 2px 9px;
  letter-spacing: .04em; font-variant-numeric: tabular-nums;
}
.artfiche .art-hd-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.artfiche .art-btn-danger { color: var(--t-alerte); }
.artfiche .art-btn-danger:hover:not(:disabled) {
  background: var(--f-alerte); border-color: var(--t-alerte); color: var(--t-alerte);
}

/* ---------------- badges ---------------- */
.artfiche .art-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; padding: 3px 11px; border-radius: 13px;
}
.artfiche .art-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.artfiche .art-badge.art-plat::before { display: none; }
.artfiche .art-b-succes  { background: var(--f-succes);  color: var(--t-succes); }
.artfiche .art-b-attente { background: var(--f-attente); color: var(--t-attente); }
.artfiche .art-b-teal    { background: var(--f-teal);    color: var(--t-teal); }
.artfiche .art-b-alerte  { background: var(--f-alerte);  color: var(--t-alerte); }
.artfiche .art-b-neutre  { background: var(--f-neutre);  color: var(--t-neutre); }

/* ---------------- onglets ---------------- */
.artfiche .art-tabs {
  display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: 14px;
  border-bottom: 1px solid var(--dgs-bordure);
}
.artfiche .art-tab {
  border: 0; background: none; padding: 9px 14px; font-size: 13px; font-weight: 500;
  color: var(--dgs-texte-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.artfiche .art-tab:hover:not(:disabled) { color: var(--dgs-vert); background: var(--dgs-survol); }
.artfiche .art-tab.actif { color: var(--dgs-vert); border-bottom-color: var(--dgs-vert); font-weight: 600; }
.artfiche .art-tab:disabled { color: var(--dgs-texte-3); cursor: not-allowed; }

/* ---------------- colonnes ---------------- */
.artfiche .art-cols { display: grid; grid-template-columns: 1.55fr 1fr; gap: 14px; align-items: start; }
.artfiche .art-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (max-width: 1000px) { .artfiche .art-cols { grid-template-columns: 1fr; } }

/* ---------------- cartes ---------------- */
.artfiche .art-card {
  background: var(--dgs-surface); border: 1px solid var(--dgs-bordure);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm); overflow: hidden;
}
.artfiche .art-card-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid var(--dgs-bordure); background: var(--dgs-muted);
}
.artfiche .art-card-t { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; }
.artfiche .art-card-t svg { color: var(--dgs-vert); }
.artfiche .art-card-bd { padding: 14px; }

/* ---------------- champs ---------------- */
.artfiche .art-fields { display: grid; gap: 12px; }
.artfiche .art-g2 { grid-template-columns: 1fr 1fr; }
.artfiche .art-g3 { grid-template-columns: 1fr 1fr 1fr; }
.artfiche .art-g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .artfiche .art-g4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) {
  .artfiche .art-g2, .artfiche .art-g3, .artfiche .art-g4 { grid-template-columns: 1fr; }
}
.artfiche .art-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.artfiche .art-lbl {
  font-size: 11.5px; font-weight: 500; color: var(--dgs-texte-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.artfiche .art-inp, .artfiche .art-sel {
  width: 100%; height: 34px; padding: 0 10px; font-size: 13px;
  border: 1px solid var(--dgs-bordure-forte); border-radius: var(--r-sm);
  background: var(--dgs-surface); color: var(--dgs-texte);
}
.artfiche textarea.art-inp { height: auto; padding: 8px 10px; resize: vertical; }
.artfiche .art-inp:focus, .artfiche .art-sel:focus { border-color: var(--dgs-vert); outline: none; }
.artfiche .art-inp:disabled, .artfiche .art-sel:disabled {
  background: var(--dgs-muted); color: var(--dgs-texte-2); cursor: not-allowed;
}
.artfiche .art-num { text-align: right; font-variant-numeric: tabular-nums; }
.artfiche .art-calcule { background: var(--dgs-highlight); color: var(--dgs-texte); font-weight: 500; }
.artfiche .art-suffixe { position: relative; display: flex; align-items: center; }
.artfiche .art-suffixe input { padding-right: 34px; }
.artfiche .art-suffixe span {
  position: absolute; right: 10px; font-size: 11.5px; color: var(--dgs-texte-3); pointer-events: none;
}
.artfiche .art-hint {
  font-size: 10.5px; font-weight: 500; color: var(--dgs-texte-3);
  background: var(--dgs-muted); border: 1px solid var(--dgs-bordure); border-radius: 6px; padding: 1px 6px;
}
.artfiche .art-aide { font-size: 11.5px; color: var(--dgs-texte-2); margin: 9px 0 0; line-height: 1.5; }
.artfiche .art-inactif { opacity: .5; }

/* ---------------- segment (plans A/B, vente au détail) ---------------- */
.artfiche .art-seg {
  display: inline-flex; background: var(--dgs-muted); border: 1px solid var(--dgs-bordure);
  border-radius: var(--r-md); padding: 3px; gap: 3px; margin-bottom: 13px;
}
.artfiche .art-seg button {
  border: 0; background: none; border-radius: var(--r-sm); padding: 6px 16px;
  font-size: 13px; font-weight: 500; color: var(--dgs-texte-2); cursor: pointer;
  display: inline-flex; align-items: baseline; gap: 6px;
}
.artfiche .art-seg button.actif {
  background: var(--dgs-surface); color: var(--dgs-vert); font-weight: 600; box-shadow: var(--sh-sm);
}
.artfiche .art-seg-sub { font-size: 10.5px; font-weight: 400; color: var(--dgs-texte-3); }
.artfiche .art-seg-sm { margin-bottom: 0; }
.artfiche .art-seg-sm button { padding: 4px 12px; font-size: 12px; }
.artfiche .art-detail-toggle { display: flex; align-items: center; gap: 9px; }
.artfiche .art-tva-box { display: flex; align-items: center; gap: 7px; }
.artfiche .art-sel-tva { width: auto; min-width: 92px; height: 30px; font-size: 12.5px; }

/* ---------------- bandeau miroir du plan B ---------------- */
.artfiche .art-miroir {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--f-attente); border-radius: var(--r-md); padding: 9px 12px; margin-bottom: 13px;
}
.artfiche .art-miroir-actif { background: var(--f-succes); }
.artfiche .art-miroir-txt { font-size: 11.5px; color: var(--dgs-texte); flex: 1; min-width: 180px; }

/* ---------------- natures ---------------- */
.artfiche .art-natures { display: flex; gap: 6px; flex-wrap: wrap; }
.artfiche .art-nature {
  border: 1px solid var(--dgs-bordure-forte); background: var(--dgs-surface);
  border-radius: var(--r-sm); padding: 6px 12px; font-size: 12.5px;
  color: var(--dgs-texte-2); cursor: pointer;
}
.artfiche .art-nature:hover { background: var(--dgs-survol); border-color: #C9E7D6; color: var(--dgs-vert); }
.artfiche .art-nature.actif { background: var(--dgs-vert); border-color: var(--dgs-vert); color: #fff; font-weight: 500; }

/* ---------------- carte stock / PMP ---------------- */
.artfiche .art-ent-row {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline;
  font-size: 12.5px; padding: 5px 0; border-bottom: 1px dashed var(--dgs-bordure);
}
.artfiche .art-ent-row.art-total {
  font-weight: 600; border-bottom: 0; border-top: 1px solid var(--dgs-bordure-forte); margin-top: 2px;
}
.artfiche .art-vide { font-size: 12.5px; color: var(--dgs-texte-3); font-style: italic; padding: 6px 0; }
.artfiche .art-paire { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.artfiche .art-kv { background: var(--dgs-muted); border-radius: var(--r-sm); padding: 9px 11px; }
.artfiche .art-kv-lbl { font-size: 11px; color: var(--dgs-texte-2); margin-bottom: 2px; }
.artfiche .art-kv-val { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------------- placeholders image / code-barres ---------------- */
.artfiche .art-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  min-height: 120px; border: 1.5px dashed var(--dgs-bordure-forte); border-radius: var(--r-md);
  color: var(--dgs-texte-3); font-size: 12.5px; margin-bottom: 10px;
}
.artfiche .art-barcode { display: flex; justify-content: center; color: var(--dgs-texte); padding: 6px 0 10px; }
.artfiche .art-w100 { width: 100%; justify-content: center; }
