/* ============================================================================
   demo.css : démo interactive du produit (page demo.html).
   Préfixes : .dx- (player) / .dxa- (coquille app) / .dxs- (écrans) / .m* (kit
   Material-like : mfield, mbtn, mtable, mcard).
   Le cadre produit garde volontairement le look CLAIR de l'app (comme la
   capture du hero), quel que soit le thème du site : palette scopée --dxa-*.
   Les écrans sont des MIROIRS des pages réelles d'elityx-ui (mêmes structures,
   mêmes libellés, mêmes couleurs) : ne pas inventer d'écran.
   ========================================================================== */

/* ---------- Player ---------- */
.dx-demo { padding-top: 28px; padding-bottom: 36px; }

.dx-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.dx-head h1 { margin: 4px 0 0; font-size: clamp(1.4rem, 3vw, 2rem); }
.dx-head-actions { display: flex; gap: 8px; }

.dx-btn {
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 9px; padding: 8px 14px; font: inherit; font-weight: 600;
  cursor: pointer; transition: border-color .12s ease, background .12s ease;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.dx-btn:hover { border-color: var(--brand); color: var(--brand-dark); }
.dx-btn[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }
.dx-btn-ghost { background: transparent; }

.dx-layout { display: grid; grid-template-columns: 230px 1fr; gap: 18px; align-items: start; }

/* Rail de chapitres */
.dx-rail { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dx-rail button {
  width: 100%; text-align: left; display: flex; align-items: center; gap: 10px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  font: inherit; font-size: .92rem; padding: 8px 10px; border-radius: 9px; cursor: pointer;
}
.dx-rail button:hover { background: var(--bg-alt); color: var(--text); }
.dx-rail button[aria-current="step"] { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.dx-rail .dx-num {
  flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: .78rem; font-weight: 700;
  background: var(--bg-alt); color: var(--muted);
}
.dx-rail button[aria-current="step"] .dx-num { background: var(--brand); color: #fff; }
.dx-rail button.seen .dx-num { background: color-mix(in srgb, var(--brand) 18%, var(--bg-alt)); color: var(--brand-dark); }

/* Scène */
.dx-stagewrap { min-width: 0; }
.dx-stage {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius);
  background: #e9edf3; box-shadow: var(--shadow); overflow: hidden; outline: none;
}
.dx-stage:focus-visible { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent); }
:root[data-theme="dark"] .dx-stage { border-color: #3b4a61; background: #243246; }

/* ---------- Cadre = iframe du vrai produit (demo-app.html) ----------
   Boîte logique 1280x800 (desktop réel) mise à l'échelle ; l'iframe la remplit.
   Curseur, snackbar et callout sont des calques par-dessus, dans ce repère. */
.dx-viewport {
  position: relative; width: 1280px; height: 800px;
  transform-origin: 0 0; transform: scale(var(--dx-scale, 1)); background: #fff;
}
iframe.dx-frame {
  width: 1280px; height: 800px; border: 0; display: block; background: #fff;
  color-scheme: light;
}
/* Chapitre 1 : page d'inscription plein cadre (pas de coquille app) */
.dx-frame.auth { grid-template-columns: 1fr; }
.dx-frame.auth .dxa-side, .dx-frame.auth .dxa-topbar { display: none; }

/* Sidenav (240px réels, items 44px : représentés à l'échelle du cadre) */
.dxa-side { background: var(--dxa-side); color: #cbd5e1; display: flex; flex-direction: column; overflow: hidden; }
.dxa-brand {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px 9px;
  border-bottom: 1px solid rgba(255,255,255,.08); color: #f1f5f9; font-weight: 700;
  font-size: 13.5px; letter-spacing: .4px;
}
.dxa-menu { display: flex; flex-direction: column; padding: 5px 7px 0; gap: 1px; }
.dxa-sect { font-size: 8.5px; text-transform: uppercase; letter-spacing: .7px; color: rgba(255,255,255,.4); padding: 6px 8px 2px; }
.dxa-menu a {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 7px;
  color: #94a3b8; font-size: 11px; text-decoration: none;
}
.dxa-menu a svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.dxa-menu a.active { background: rgba(99,102,241,.15); color: var(--dxa-indigo); }
/* Section Favoris (étoile ambre + bouton gérer) et entrée repliée (Paramètres) */
.dxa-sect.fav { display: flex; align-items: center; gap: 4px; color: rgba(255,255,255,.55); }
.favic { width: 11px; height: 11px; fill: none; stroke: #f5a623; stroke-width: 1.8; }
.tuneic { width: 11px; height: 11px; fill: none; stroke: rgba(255,255,255,.4); stroke-width: 1.8; margin-left: auto; }
.dxa-collapsed .chev { width: 12px; height: 12px; margin-left: auto; stroke-width: 2; }

/* Toolbar (56px réels) */
.dxa-main { display: flex; flex-direction: column; min-width: 0; }
.dxa-topbar {
  height: 38px; flex: none; background: var(--dxa-card); border-bottom: 1px solid var(--dxa-border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05); position: relative; z-index: 3;
}
.dxa-crumb { color: var(--dxa-muted); font-size: 11.5px; }
.dxa-top-right { display: flex; align-items: center; gap: 8px; }
.dxa-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: 999px; background: #f1f5f9; color: #475569; font-size: 11px; font-weight: 500;
}
.dxa-chip svg { width: 12px; height: 12px; fill: none; stroke: #64748b; stroke-width: 1.8; }
.dxa-bell { display: inline-flex; position: relative; }
.dxa-bell svg { width: 15px; height: 15px; fill: none; stroke: #64748b; stroke-width: 1.8; }
.dxa-user { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; color: var(--dxa-text); }
.dxa-avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--dxa-blue); color: #fff; font-size: 9.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; letter-spacing: .5px; }
.dxa-caret { width: 14px; height: 14px; fill: none; stroke: #64748b; stroke-width: 2; }
.dxa-content { padding: 14px 16px; overflow: hidden; position: relative; flex: 1; background: var(--dxa-bg); }

/* ---------- Kit Material-like ---------- */
.dxs-h2 { margin: 0 0 10px; font-size: 15.5px; font-weight: 500; color: var(--dxa-text); display: flex; align-items: center; gap: 7px; }
.dxs-h2.nomargin { margin: 0; }
.dxs-h3 { margin: 10px 0 8px; font-size: 12.5px; font-weight: 600; color: var(--dxa-text); display: flex; align-items: center; gap: 6px; }
.dxs-h3.nomargin { margin: 0; }
.hic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.hic3 { width: 14px; height: 14px; fill: none; stroke: var(--dxa-muted); stroke-width: 2; }

.mcard {
  background: var(--dxa-card); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
}
.mcard.pad0 { padding: 6px; }

/* Champ Material outline (label flottant) */
.mfield {
  position: relative; border: 1px solid #aeb8c4; border-radius: 4px;
  padding: 7px 10px 6px; min-height: 30px; background: var(--dxa-card); margin-bottom: 10px;
}
.mfield > span {
  position: absolute; top: -6px; left: 8px; padding: 0 4px; background: var(--dxa-card);
  font-size: 9px; color: var(--dxa-muted); white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis;
}
.mfield input {
  border: 0; outline: none; width: 100%; font: inherit; font-size: 11.5px;
  color: var(--dxa-text); background: transparent; pointer-events: none; padding: 0;
}
.mfield input::placeholder { color: #9aa6b2; }
.mfield.dx-focus { border-color: var(--dxa-blue); box-shadow: inset 0 0 0 1px var(--dxa-blue); }
.mfield.dx-focus > span { color: var(--dxa-blue); }
.mfield.full { width: 100%; }
.mfield.grow { flex: 1; min-width: 150px; }
.mfield.sel input { padding-right: 16px; }
.mfield.sm { margin-bottom: 0; min-width: 90px; }
.mfield.rel { overflow: visible; }
.mcaret { position: absolute; right: 6px; top: 50%; transform: translateY(-42%); width: 14px; height: 14px; fill: none; stroke: #64748b; stroke-width: 2; }
.mprefix { position: absolute; left: 9px; top: 50%; transform: translateY(-38%); width: 13px; height: 13px; fill: none; stroke: #64748b; stroke-width: 2; }
.mfield input.indent { padding-left: 19px; }
.mhint { margin: -4px 0 10px 2px; font-size: 9.5px; color: var(--dxa-muted); }

.mcheck { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--dxa-text); margin: 4px 0 10px; }
.mcheck i { width: 13px; height: 13px; border: 2px solid #8d99a6; border-radius: 2.5px; flex: none; }
.mcheck.on i { background: var(--dxa-blue); border-color: var(--dxa-blue); position: relative; }
.mcheck.on i::after { content: "✓"; position: absolute; inset: -3px 0 0 1px; color: #fff; font-size: 10px; font-weight: 700; }
.mcheck u { color: var(--dxa-blue); }

/* Boutons Material */
.mbtn {
  border: 0; border-radius: 4px; padding: 6px 14px; font: inherit; font-size: 11.5px;
  font-weight: 500; letter-spacing: .2px; cursor: default; background: transparent;
  color: var(--dxa-blue); display: inline-flex; align-items: center; gap: 5px;
}
.mbtn-raised { background: var(--dxa-blue); color: #fff; box-shadow: 0 2px 3px rgba(0,0,0,.18); }
.mbtn-accent { background: var(--dxa-green); color: #fff; box-shadow: 0 2px 3px rgba(0,0,0,.18); }
.mbtn-stroked { border: 1px solid #c8d0d9; background: var(--dxa-card); color: var(--dxa-text); }
.mbtn-stroked.primary { color: var(--dxa-blue); }
.mbtn-stroked.warn { color: var(--dxa-warn); }
.mbtn.sm { padding: 4px 10px; font-size: 10.5px; }
.mbtn.dx-press { filter: brightness(.85); }
.bic { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; }
.bic.caret { width: 13px; height: 13px; }

/* Table Material */
.mtable { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.mtable th {
  text-align: left; font-size: 10px; font-weight: 600; color: var(--dxa-muted);
  padding: 7px 8px; border-bottom: 1px solid var(--dxa-border); white-space: nowrap;
}
.mtable td { padding: 8px; border-bottom: 1px solid var(--dxa-header); color: var(--dxa-text); }
.mtable td.r { text-align: right; }
.mtable td.ok { color: var(--dxa-green); font-weight: 600; }
.mtable.sm th, .mtable.sm td { padding: 6px 7px; font-size: 10.5px; }
.mlink { color: var(--dxa-blue); font-weight: 500; }
.mmore { width: 16px; height: 16px; fill: none; stroke: #64748b; stroke-width: 2; }

/* Badges de statut (couleurs réelles) */
.dxs-badge { display: inline-block; border-radius: 12px; padding: 2px 9px; font-size: 10px; font-weight: 500; }
.dxs-badge[data-badge="DRAFT"]     { background: #eceff1; color: #546e7a; }
.dxs-badge[data-badge="VALIDATED"] { background: #e3f2fd; color: #1976d2; }
.dxs-badge[data-badge="SENT"]      { background: #e8eaf6; color: #5c6bc0; }
.dxs-badge[data-badge="PAID"]      { background: #e8f5e9; color: #43a047; }
.dxs-badge[data-badge="READY"]     { background: #fff3e0; color: #e65100; }

/* ---------- Écrans ---------- */

/* Page list (page-card + filter bar, miroir client-list / supplier-invoice-list) */
.dxs-pagecard { padding: 14px 16px; }
.dxs-pagehead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.dxs-pagehead.left { justify-content: flex-start; gap: 8px; }
.dxs-pagehead.tight { margin-bottom: 4px; }
.dxs-headactions { display: flex; align-items: center; gap: 7px; }
.dxs-backic { width: 16px; height: 16px; fill: none; stroke: var(--dxa-muted); stroke-width: 2; }
.dxs-filterbar {
  display: flex; gap: 8px; align-items: flex-start; padding: 9px 10px 1px; margin-bottom: 10px;
  background: var(--dxa-header); border: 1px solid var(--dxa-border); border-radius: 8px;
}
.dxs-filterbar .mfield { margin-bottom: 8px; }
.dxs-filterbar .mfield.sel { min-width: 110px; }
.dxs-emptystate { text-align: center; padding: 18px 0 10px; color: var(--dxa-muted); }
.dxs-emptystate svg { width: 30px; height: 30px; fill: none; stroke: #b6c0cb; stroke-width: 1.6; }
.dxs-emptystate h4 { margin: 6px 0 2px; font-size: 12.5px; color: var(--dxa-text); }
.dxs-emptystate p { margin: 0 0 10px; font-size: 11px; }

/* Onglets Material */
.dxs-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--dxa-border); margin-bottom: 10px; }
.dxs-tabs span {
  padding: 7px 13px; font-size: 11px; font-weight: 500; color: var(--dxa-muted);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.dxs-tabs span.active { color: var(--dxa-blue); border-bottom-color: var(--dxa-blue); }

/* Pages détail (detail-page) */
.dxs-detail { max-width: 560px; margin: 0 auto; }
.dxs-detail.wide { max-width: 620px; }
/* Défilement simulé : la vraie page scrolle, le cadre translate son contenu. */
.dxs-scrollable { transition: transform .45s ease; }
.dxs-row2.vies { grid-template-columns: 1fr auto; align-items: center; }
.dxs-row2.vies .mbtn { margin-bottom: 10px; }
.dxs-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.dxs-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px; }
.dxs-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 8px; }
.dxs-hint { font-size: 10.5px; color: var(--dxa-muted); margin: 0 0 10px; }
.dxs-sub { margin: 1px 0 0; font-size: 10px; color: var(--dxa-muted); line-height: 1.35; }

/* Autocomplete annuaire entreprises */
.dxs-dd {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 6; margin-top: 3px;
  background: var(--dxa-card); border-radius: 4px;
  box-shadow: 0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14);
  overflow: hidden;
}
.dxs-dd button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%;
  text-align: left; border: 0; background: transparent; padding: 8px 12px; font: inherit;
}
.dxs-dd button b { font-size: 11.5px; font-weight: 500; color: var(--dxa-text); }
.dxs-dd button small { font-size: 10px; color: var(--dxa-muted); }
.dxs-dd button:hover { background: var(--dxa-header); }

/* Cartes de section du formulaire consultant */
.dxs-formcard { padding: 12px 14px 10px; }
.dxs-cardhead { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.dxs-cardavatar {
  width: 30px; height: 30px; border-radius: 50%; background: #e3f2fd; color: var(--dxa-blue);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.dxs-cardavatar svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }

/* Inscription (signup réel : fond dégradé + carte + stepper) */
.dxs-signup-page {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f1f5f9 0%, #e0e7ff 100%); padding: 14px;
}
.dxs-signup-card {
  width: 480px; background: #fff; border-radius: 10px; padding: 14px 22px 10px;
  box-shadow: 0 8px 26px rgba(30,58,95,.16);
}
/* Densité : le formulaire complet (étape 1 = 8 champs) doit tenir dans le cadre 540px. */
.dxs-signup-card .mfield { margin-bottom: 8px; min-height: 27px; padding: 6px 10px 5px; }
.dxs-signup-card .mhint { margin: -2px 0 8px 2px; }
.dxs-signup-card .dxs-hint { margin-bottom: 8px; }
.mcaret.eye { width: 13px; height: 13px; }
.dxs-signup-header { text-align: center; margin-bottom: 8px; }
.dxs-signup-header h3 { margin: 0 0 2px; font-size: 15px; color: #1e3a5f; }
.dxs-signup-header p { margin: 0; font-size: 10px; color: #64748b; }
.dxs-stepper { display: flex; align-items: center; gap: 8px; margin: 8px 0 12px; }
.dxs-step { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--dxa-muted); font-weight: 500; }
.dxs-step i {
  width: 18px; height: 18px; border-radius: 50%; background: #c2cad3; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 10px;
}
.dxs-step.active { color: var(--dxa-text); }
.dxs-step.active i { background: var(--dxa-blue); }
.dxs-step.done i { background: var(--dxa-green); }
.dxs-sep { flex: 1; height: 1px; background: var(--dxa-border); }
.dxs-step-actions { display: flex; justify-content: flex-end; margin-top: 4px; }
.dxs-step-actions.split { justify-content: space-between; }
.dxs-signup-footer { text-align: center; margin: 10px 0 0; font-size: 10px; color: #64748b; }
.dxs-signup-footer u { color: var(--dxa-blue); }

/* Checklist onboarding (gradient réel + step-cards) */
.dxs-onboarding {
  position: relative; padding: 12px 16px; margin-bottom: 10px; border-radius: 10px;
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%); border: 1px solid #c7d2fe;
}
.dxs-ob-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.dxs-ob-rocket { width: 26px; height: 26px; fill: none; stroke: #6366f1; stroke-width: 1.7; flex: none; }
.dxs-ob-header h3 { margin: 0; font-size: 13px; color: #1e3a5f; }
.dxs-ob-header p { margin: 1px 0 0; font-size: 10px; color: var(--dxa-muted); }
.dxs-ob-progress { height: 4px; border-radius: 99px; background: #e0e7ff; overflow: hidden; }
.dxs-ob-progress span { display: block; height: 100%; background: #6366f1; transition: width .5s ease; }
.dxs-ob-label { font-size: 9.5px; color: var(--dxa-muted); margin: 4px 0 8px; }
.dxs-ob-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.dxs-ob-step {
  background: var(--dxa-card); border: 1px solid var(--dxa-border); border-radius: 8px;
  padding: 8px 10px; display: flex; flex-direction: column; gap: 4px;
}
.dxs-ob-close { position: absolute; top: 6px; right: 10px; color: var(--dxa-muted); font-size: 10px; }
.dxs-ob-step .row { display: flex; align-items: center; justify-content: space-between; }
.dxs-ob-step .sic { width: 15px; height: 15px; fill: none; stroke: #6366f1; stroke-width: 1.8; }
.dxs-ob-step.done .sic { stroke: #16a34a; }
.dxs-ob-step .num {
  width: 18px; height: 18px; border-radius: 50%; background: var(--dxa-border); color: var(--dxa-muted);
  font-weight: 600; font-size: 9.5px; display: flex; align-items: center; justify-content: center;
}
.dxs-ob-step h4 { margin: 0; font-size: 10.5px; }
.dxs-ob-step p { margin: 0; font-size: 8.8px; color: var(--dxa-muted); line-height: 1.3; }
.dxs-ob-step .mbtn { padding: 3px 8px; font-size: 9px; align-self: flex-start; }
.dxs-ob-step.done { background: #f0fdf4; border-color: #86efac; }
.dxs-ob-step.done .num { background: #16a34a; color: #fff; }
.dxs-ob-step.done .mbtn { visibility: hidden; }
.dxs-ob-step.done::after { content: "Fait"; color: #16a34a; font-weight: 500; font-size: 9.5px; }
.dxs-ob-demo {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--dxa-border);
  font-size: 9.5px; color: var(--dxa-muted);
}

/* Widgets dashboard */
.dxs-widgets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dxs-widget { padding: 12px 14px; }
.dxs-widget-h { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.dxs-widget-h h4 { margin: 0; font-size: 11.5px; font-weight: 500; }
.wic { width: 15px; height: 15px; fill: none; stroke-width: 2; }
.wic.blue { stroke: #2563eb; } .wic.purple { stroke: #7c3aed; } .wic.green { stroke: #16a34a; } .wic.orange { stroke: #ea580c; }
.dxs-widget-empty { margin: 0; font-size: 10.5px; color: var(--dxa-muted); }

/* Activité commerciale (contract-kpis réel) + Évolution du CA (placeholder vide) */
.dxs-ckpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.dxs-ckpis .ck {
  display: flex; flex-direction: column; gap: 2px; padding: 8px 10px;
  border: 1px solid var(--dxa-border); border-radius: 9px; background: var(--dxa-header);
}
.dxs-ckpis .ckic { width: 16px; height: 16px; fill: none; stroke: #2563eb; stroke-width: 1.8; margin-bottom: 2px; }
.dxs-ckpis .ckic.txt { font-size: 13px; font-weight: 700; color: #2563eb; width: auto; height: auto; }
.dxs-ckpis b { font-size: 13px; font-weight: 700; }
.dxs-ckpis i { font-style: normal; font-size: 8.5px; color: var(--dxa-muted); }
.dxs-emptyplot {
  height: 64px; margin-top: 8px; border-bottom: 1px solid var(--dxa-border);
  border-left: 1px solid var(--dxa-border); border-radius: 0 0 0 2px;
  background: repeating-linear-gradient(to top, transparent 0 15px, var(--dxa-header) 15px 16px);
}

/* CRA : en-tête + barre d'infos + tableur (worklog-form réel) */
.dxs-wlhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.dxs-wlhead .left, .dxs-wlhead .right { display: flex; align-items: center; gap: 7px; }
.dxs-chip { font-size: 10px; padding: 2px 8px; border-radius: 10px; margin-left: 6px; font-weight: 500; vertical-align: middle; }
.dxs-chip[data-chip="draft"]     { background: #f1f5f9; color: #64748b; }
.dxs-chip[data-chip="submitted"] { background: #fff7ed; color: #c2410c; }
.dxs-chip[data-chip="validated"] { background: #f0fdf4; color: #16a34a; }
.dxs-infobar {
  display: flex; gap: 20px; padding: 8px 12px; background: var(--dxa-header);
  border-radius: 8px; margin-bottom: 8px;
}
.dxs-infobar i { display: block; font-style: normal; font-size: 8.5px; color: var(--dxa-muted); text-transform: uppercase; font-weight: 500; letter-spacing: .3px; }
.dxs-infobar b { font-size: 11.5px; font-weight: 500; }
.dxs-fill { padding: 1px 7px; border-radius: 10px; font-size: 10.5px !important; font-weight: 600 !important; }
.dxs-fill[data-fill="red"]    { background: #fef2f2; color: #dc2626; }
.dxs-fill[data-fill="orange"] { background: #fff7ed; color: #c2410c; }
.dxs-fill[data-fill="green"]  { background: #f0fdf4; color: #16a34a; }
.dxs-summary { margin-bottom: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.dxs-sumchip {
  font-size: 10px; font-weight: 500; padding: 2px 9px; border-radius: 10px;
  border: 1px solid var(--dxa-border); background: var(--dxa-card); color: var(--dxa-text);
}
.dxs-sumchip:not(:first-child) { color: var(--dxa-muted); }
.dxs-sheet { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.dxs-sheet th, .dxs-sheet td { border-bottom: 1px solid var(--dxa-border); border-right: 1px solid var(--dxa-header); padding: 0; }
.dxs-sheet thead th { font-size: 8.5px; font-weight: 600; line-height: 1.1; padding: 2px 0; text-align: center; color: var(--dxa-text); }
.dxs-sheet thead th i { display: block; font-style: normal; font-size: 7px; color: #94a3b8; font-weight: 400; }
.dxs-sheet .holrow th { font-size: 6.5px; padding: 0 0 1px; border-bottom: 1px solid var(--dxa-border); }
.dxs-sheet .hol2 { color: #1565c0; font-weight: 500; }
.dxs-sheet .lh { width: 128px; text-align: left; padding: 3px 6px; border-right: 2px solid var(--dxa-border); }
.dxs-sheet .tot { width: 34px; text-align: center; font-weight: 600; font-size: 10px; background: var(--dxa-header); border-left: 2px solid var(--dxa-border); }
.dxs-sheet tbody td { height: 30px; text-align: center; font-size: 10px; font-weight: 500; }
.dxs-sheet .we { background: var(--dxa-header); }
.dxs-sheet thead .hol, .dxs-sheet tbody .hol { background: #e3f2fd; }
.dxs-sheet tbody .wd.fill { color: var(--dxa-text); }
.dxs-sheet tbody .wd.fill::after { content: "1"; }
.line-info { display: flex; flex-direction: column; gap: 1px; }
.line-info b { font-size: 9px; line-height: 1.2; }
.line-info small { font-size: 8px; color: var(--dxa-muted); }
.line-actions { display: flex; gap: 4px; margin-top: 2px; }
.lact {
  border: 1px solid #c8d0d9; background: var(--dxa-card); color: var(--dxa-blue);
  font-size: 8px; border-radius: 4px; padding: 0 5px; height: 15px; font-weight: 600;
}
.lact.warn { color: var(--dxa-warn); }
.dxs-sheet .footrow td { background: var(--dxa-header); border-top: 2px solid var(--dxa-border); height: 22px; }
.dxs-sheet .footrow .lh b { font-size: 9.5px; }
.dxs-addline { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.dxs-addline .mfield { min-width: 120px; }

/* Panneau LME replié (mat-expansion-panel du contract-edit réel) */
.dxs-lmepanel {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-bottom: 10px;
  background: var(--dxa-card); border: 1px solid var(--dxa-border); border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06); font-size: 11px;
}
.dxs-lmepanel .lme-title { font-weight: 500; }
.dxs-lmepanel .lme-sum { margin-left: auto; color: var(--dxa-muted); }
.dxs-lmepanel .lme-chev { width: 13px; height: 13px; fill: none; stroke: #64748b; stroke-width: 2; }
.mhint.link { color: var(--dxa-blue); }

/* Dialog résultat de génération (mat-dialog, overlay dans le cadre) */
.dxs-modal {
  position: absolute; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center;
  background: rgba(15,23,42,.4);
}
.dxs-modal-box {
  width: 320px; background: var(--dxa-card); border-radius: 10px; padding: 14px 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
}
.dxs-modal-title { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--dxa-text); }
.okic { width: 15px; height: 15px; fill: none; stroke: var(--dxa-green); stroke-width: 2.4; flex: none; }
.dxs-genok { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #15803d; margin-bottom: 8px; }
.dxs-genitem {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 11px; background: var(--dxa-header); border-radius: 8px; font-size: 11.5px; margin-bottom: 8px;
}

/* Facture : stepper réel Brouillon → Validée → Envoyée → Payée */
.dxs-invactions { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 8px; }
.dxs-invstepper { display: flex; align-items: center; gap: 0; margin-bottom: 8px; }
.dxs-invstepper .st {
  flex: 1; display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--dxa-muted);
  padding: 5px 8px; position: relative;
}
.dxs-invstepper .st i {
  width: 14px; height: 14px; border-radius: 50%; background: #cbd5e1; flex: none;
}
.dxs-invstepper .st.on { color: var(--dxa-text); font-weight: 600; }
.dxs-invstepper .st.on i { background: var(--dxa-blue); box-shadow: 0 0 0 3px #e3f2fd; }
.dxs-invstepper .st.done { color: var(--dxa-green); }
.dxs-invstepper .st.done i { background: var(--dxa-green); }
.dxs-invstepper .st small { display: block; font-size: 8px; color: var(--dxa-muted); font-weight: 400; margin-left: 2px; }
.dxs-stepactions { display: flex; gap: 7px; margin-bottom: 8px; }
.dxs-invdetails {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; margin: 8px 0 4px;
  font-size: 11px; color: var(--dxa-text);
}
.dxs-invdetails b { font-weight: 600; }
.editic { width: 13px; height: 13px; fill: none; stroke: var(--dxa-blue); stroke-width: 2; vertical-align: -2px; }
.editic.sm { width: 11px; height: 11px; }
.dxs-recip { margin: 4px 0 0; font-size: 11px; }
.dxs-recip .muted { color: var(--dxa-muted); }
/* LME : grille de 3 montants + paragraphe légal + lignes éditables (invoice-detail réel) */
.dxs-lmegrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.dxs-lmegrid > div { display: flex; flex-direction: column; gap: 2px; padding: 7px 10px; background: var(--dxa-header); border-radius: 8px; }
.dxs-lmegrid i { font-style: normal; font-size: 8.5px; color: var(--dxa-muted); }
.dxs-lmegrid b { font-size: 11.5px; font-weight: 600; }
.dxs-lmelegal { margin: 0 0 8px; font-size: 9.5px; color: var(--dxa-muted); line-height: 1.45; }
.dxs-lmeline { margin: 3px 0; font-size: 10.5px; color: var(--dxa-text); }
.dxs-lmeline b { font-weight: 600; }
.dxs-sealed { background: #dcfce7; color: #15803d; border-radius: 12px; padding: 1px 8px; font-size: 9.5px; font-weight: 600; }
.dx-faded { color: var(--dxa-muted); opacity: .6; }
.dxs-invtotals { text-align: right; font-size: 11px; padding-top: 8px; }
.dxs-invtotals p { margin: 2px 0; color: var(--dxa-muted); }
.dxs-invtotals b { color: var(--dxa-text); }
.dxs-invtotals .ttc { font-size: 12.5px; }
.dxs-invtotals .ttc b { color: var(--dxa-blue); }
.dxs-pdf { position: absolute; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 7; }
.dxs-pdf-page {
  width: 330px; background: #fff; border-radius: 6px; padding: 16px 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.35); font-size: 11px; color: #1e293b;
}
.dxs-pdf-page p { margin: 6px 0; }
.dxs-pdf-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin-bottom: 6px; }
.dxs-pdf-foot { color: #16a34a; font-weight: 600; border-top: 1px dashed #e2e8f0; padding-top: 8px; }

/* Synthèse totaux (factures fournisseurs) */
.dxs-totsummary {
  display: flex; gap: 24px; padding: 8px 12px; margin-bottom: 10px;
  background: var(--dxa-header); border: 1px solid var(--dxa-border); border-radius: 8px;
}
.dxs-totsummary i { display: block; font-style: normal; font-size: 8.5px; color: var(--dxa-muted); text-transform: uppercase; letter-spacing: .3px; }
.dxs-totsummary b { font-size: 11.5px; }

/* Notes de frais : bannière info, aperçu déductibilité, reçu scanné */
.dxs-note {
  display: flex; align-items: flex-start; gap: 6px; margin: 0 0 10px; font-size: 10px;
  color: var(--dxa-muted); line-height: 1.4;
}
.nic { width: 13px; height: 13px; flex: none; fill: none; stroke: var(--dxa-blue); stroke-width: 2; margin-top: 1px; }
.dxs-scanmenu {
  position: absolute; top: 44px; right: 110px; z-index: 6; width: 160px;
  background: var(--dxa-card); border-radius: 4px; overflow: hidden;
  box-shadow: 0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14);
}
.dxs-scanmenu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 12px; font: inherit; font-size: 11px; }
.dxs-scanmenu button:hover { background: var(--dxa-header); }
.dxs-preview {
  display: flex; flex-direction: column; gap: 2px; background: #e8f5e9; border: 1px solid #c8e6c9;
  border-radius: 10px; padding: 8px 11px; font-size: 10.5px; color: #1b5e20; margin-bottom: 8px;
}
.dxs-preview small { color: #2e7d32; font-size: 9.5px; }
.dxs-scanattached {
  background: #e3f2fd; border: 1px solid #bbdefb; border-radius: 10px;
  padding: 7px 11px; font-size: 10.5px; color: #0d47a1; margin-bottom: 8px;
}
.dxs-receipt { position: absolute; right: 16px; top: 86px; z-index: 6; }
.dxs-ticket {
  width: 168px; background: #fffdf5; color: #233; border: 1px solid #e7e2cf; border-radius: 4px;
  padding: 10px 12px 14px; font-size: 10.5px; box-shadow: 0 10px 26px rgba(15,23,42,.22);
  display: flex; flex-direction: column; gap: 3px; font-family: "Consolas", "Courier New", monospace;
}
.dxs-ticket b { text-align: center; letter-spacing: 1px; }
.dxs-ticket i { font-style: normal; float: right; }
.dxs-ticket span { display: flex; justify-content: space-between; gap: 6px; }
.dxs-ticket .sep { border-top: 1px dashed #cfc9b2; margin: 3px 0; }
.dxs-ticket .tot { font-weight: 800; }
.dxs-beam {
  position: absolute; left: -4px; right: -4px; top: 0; height: 3px; border-radius: 2px;
  background: var(--dxa-blue); box-shadow: 0 0 12px 2px rgba(25,118,210,.65); opacity: 0;
}
.dxs-beam.on { animation: dx-scan 1.2s ease-in-out 1 forwards; }
@keyframes dx-scan { 0% { opacity: 1; top: 0; } 90% { opacity: 1; top: calc(100% - 3px); } 100% { opacity: 0; top: calc(100% - 3px); } }

/* Finances : KPI réels (icône carrée colorée + valeur + libellé) */
.dxs-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 10px; }
.dxs-kpi { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; margin-bottom: 0; }
.dxs-kpi .kic {
  width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center;
  justify-content: center; font-size: 14px; margin-bottom: 3px;
}
.dxs-kpi .kval { font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.dxs-kpi .klbl { font-size: 8.8px; color: var(--dxa-muted); }

/* URSSAF : blocs montants réels */
.dxs-amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.dxs-amounts .amt { display: flex; flex-direction: column; gap: 3px; padding: 9px 12px; background: var(--dxa-header); border-radius: 10px; }
.dxs-amounts .amt i { font-style: normal; font-size: 9px; color: var(--dxa-muted); }
.dxs-amounts .amt b { font-size: 12.5px; font-weight: 600; }
.dxs-amounts .amt.big b { color: #1565c0; }
.dxs-amounts .amt.total { background: #e3f2fd; }
.dxs-amounts .amt.total b { font-size: 14px; font-weight: 800; color: #0d47a1; }

/* BC : lien contrat parent (réel) */
.dxs-parentlink {
  display: flex; align-items: center; gap: 5px; margin: 0 0 8px; padding: 5px 10px;
  background: #e3f2fd; border-left: 3px solid #1565c0; border-radius: 4px;
  color: #1565c0; font-size: 10.5px; max-width: fit-content;
}
.dxs-parentlink svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; transform: rotate(180deg); }
.dxs-parentlink u { font-weight: 500; }

/* Switch multi-société (panel mat-select sous le chip) */
.dxs-switch {
  position: absolute; top: 42px; right: 14px; z-index: 8; width: 185px;
  background: var(--dxa-card); border-radius: 4px; overflow: hidden;
  box-shadow: 0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14);
}
.dxs-switch button { display: flex; width: 100%; align-items: center; justify-content: space-between; border: 0; background: transparent; padding: 9px 12px; font: inherit; font-size: 11.5px; }
.dxs-switch button.cur { font-weight: 600; color: var(--dxa-blue); background: #f5f9ff; }
.dxs-switch button svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.dxs-switch button:hover { background: var(--dxa-header); }

/* ---------- Curseur, snackbar Material, callout ---------- */
.dx-cursor {
  position: absolute; z-index: 9; width: 18px; height: 18px; left: 0; top: 0;
  transform: translate(420px, 270px); pointer-events: none;
  transition: transform .45s cubic-bezier(.45,.05,.35,1);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
}
.dx-cursor.jump { transition: none; }
.dx-cursor::before {
  content: ""; position: absolute; inset: 0;
  background: #111; clip-path: polygon(0 0, 100% 38%, 44% 49%, 38% 100%);
}
.dx-cursor .dx-ripple,
.dx-cursor::after {
  content: ""; position: absolute; left: -7px; top: -7px; width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid #1976d2; opacity: 0; transform: scale(.4);
}
.dx-cursor.click::after { animation: dx-ripple .45s ease-out 1; }
@keyframes dx-ripple { 0% { opacity: .9; transform: scale(.4); } 100% { opacity: 0; transform: scale(1.5); } }

/* Snackbar Material (sombre, action OK) */
.dx-toast {
  position: absolute; z-index: 8; left: 50%; bottom: 14px; transform: translateX(-50%) translateY(6px);
  background: #323232; color: #fff; border-radius: 4px; padding: 9px 14px;
  font-size: 11.5px; box-shadow: 0 3px 5px -1px rgba(0,0,0,.2), 0 6px 10px 0 rgba(0,0,0,.14);
  opacity: 0; transition: opacity .25s ease, transform .25s ease; pointer-events: none;
  white-space: nowrap; display: flex; align-items: center; gap: 16px;
}
.dx-toast b { color: #9fa8da; font-weight: 600; font-size: 11px; letter-spacing: .5px; }
.dx-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

.dx-callout {
  position: absolute; z-index: 8; max-width: 250px; background: #0d47a1; color: #fff;
  border-radius: 9px; padding: 8px 12px; font-size: 11.5px; font-weight: 600; line-height: 1.4;
  box-shadow: 0 10px 26px rgba(13,71,161,.4); pointer-events: none;
  opacity: 0; transform: translateY(5px); transition: opacity .25s ease, transform .25s ease;
}
.dx-callout.on { opacity: 1; transform: translateY(0); }
.dx-callout::before { content: ""; position: absolute; top: -5px; left: 22px; width: 10px; height: 10px; background: inherit; transform: rotate(45deg); }
.dx-hl { position: relative; box-shadow: 0 0 0 2px #0d47a1, 0 0 0 5px rgba(13,71,161,.25) !important; border-radius: 7px; }

.dx-hidden { display: none !important; }
/* L'attribut hidden doit toujours gagner, même face à un display déclaré par une
   classe (.dx-endcard, .dx-btn...) : sans cette règle, la carte de fin recouvrait
   la scène dès le chargement. */
[hidden] { display: none !important; }

/* ---------- Carte de fin ---------- */
.dx-endcard {
  position: absolute; inset: 0; z-index: 12; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 24px;
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(5px);
}
.dx-endcard h2 { margin: 0; font-size: clamp(1.2rem, 2.6vw, 1.7rem); }
.dx-endcard p { margin: 0; color: var(--muted); }
.dx-end-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.dx-end-note { font-size: .85rem; }

/* ---------- Caption + contrôles ---------- */
.dx-caption {
  min-height: 1.6em; margin: 12px 2px 8px; font-size: 1rem; font-weight: 600; color: var(--text);
}
.dx-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dx-progress {
  flex: 1; min-width: 160px; display: flex; gap: 3px; height: 8px; align-items: stretch;
}
.dx-progress .seg { flex: 1; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; cursor: pointer; }
.dx-progress .seg > i { display: block; height: 100%; width: 0; background: var(--brand); }
.dx-stepnav { display: inline-flex; gap: 8px; }

.dx-noscript { margin-top: 14px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-alt); }

/* ---------- Contenu indexable ---------- */
.dx-toc { margin: 0; padding-left: 20px; display: grid; gap: 9px; max-width: 760px; }
.dx-toc li { color: var(--muted); }
.dx-toc strong { color: var(--text); }
.dx-toc-cta { margin-top: 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .dx-layout { grid-template-columns: 1fr; }
  .dx-rail { flex-direction: row; overflow-x: auto; padding-bottom: 6px; gap: 6px; }
  .dx-rail li { flex: none; }
  .dx-rail button { white-space: nowrap; border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; }
}
@media (max-width: 620px) {
  .dx-head { flex-direction: column; align-items: flex-start; }
  .dx-caption { font-size: .92rem; }
  .dx-controls { row-gap: 10px; }
}

/* ---------- Reduced motion : tout est instantané ---------- */
@media (prefers-reduced-motion: reduce) {
  .dx-cursor, .dx-toast, .dx-callout, .dxs-ob-progress span, .dxs-scrollable { transition: none !important; }
  .dx-cursor.click::after, .dxs-beam.on { animation: none !important; opacity: 0; }
}
