<section class="{{cssClass}} sheet-form-layout" autocomplete="off">

  {{!-- Sheet Header --}}
  <header class="sheet-header">
    <div class="header-fields background-sheet-header">
      <div class="flexrow">
        <img class="profile-img" src="{{actor.img}}" data-action="editImage" data-edit="img" title="{{actor.name}}" />
        <div class="flexcol header-main-content">
          <div style="display: flex; align-items: center; gap: 0.3rem; width: 100%;">
            <h1 class="charname" style="flex: 1; margin: 0; min-width: 0;"><input name="name" type="text" value="{{actor.name}}" placeholder="Name" {{#if isPlayMode}}disabled{{/if}} /></h1>
            <button type="button" class="sheet-mode-toggle" data-action="toggleSheet" data-tooltip="{{#if isEditMode}}Mode Visualisation{{else}}Mode Édition{{/if}}">
              <i class="{{#if isEditMode}}fas fa-eye{{else}}fas fa-edit{{/if}}"></i>
            </button>
          </div>

          <div class="header-stats-grid">

            <div class="stat-group stat-group-alignment">
              <h4 class="stat-title">{{localize "MNBL.alignement"}}: {{alignement}}</h4>
              <div class="stat-values alignment-values">
                <div class="alignment-row">
                  <label class="alignment-label">{{localize "MNBL.law"}}</label>
                  <div class="alignment-inputs">
                    <label class="stat-label-mini">{{localize "MNBL.level"}}</label>
                    <input type="number" class="stat-input-mini" name="system.balance.loi" value="{{system.balance.loi}}" data-dtype="Number" {{#if isPlayMode}}disabled{{/if}} />
                    <label class="stat-label-mini">{{localize "MNBL.points"}}</label>
                    <select class="stat-input-mini" name="system.balance.pointsloi" value="{{system.balance.pointsloi}}" data-dtype="Number" {{#if isPlayMode}}disabled{{/if}}>
                      {{selectOptions config.listeNiveauSkill selected=system.balance.pointsloi}}
                    </select>
                  </div>
                </div>
                <div class="alignment-row">
                  <label class="alignment-label">{{localize "MNBL.chaos"}}</label>
                  <div class="alignment-inputs">
                    <label class="stat-label-mini">{{localize "MNBL.level"}}</label>
                    <input type="number" class="stat-input-mini" name="system.balance.chaos" value="{{system.balance.chaos}}" data-dtype="Number" {{#if isPlayMode}}disabled{{/if}} />
                    <label class="stat-label-mini">{{localize "MNBL.points"}}</label>
                    <select class="stat-input-mini" name="system.balance.pointschaos" value="{{system.balance.pointschaos}}" data-dtype="Number" {{#if isPlayMode}}disabled{{/if}}>
                      {{selectOptions config.listeNiveauSkill selected=system.balance.pointschaos}}
                    </select>
                  </div>
                </div>
                <div class="alignment-info">
                  <span class="info-label">{{localize "MNBL.aspect"}}: <strong>{{aspect}}</strong></span>
                  <span class="info-label">{{localize "MNBL.margin"}}: <strong>{{marge}}</strong></span>
                </div>
              </div>
            </div>

            <div class="stat-group">
              <h4 class="stat-title">{{localize "MNBL.goodadventure"}}</h4>
              <div class="stat-values">
                <div class="stat-item">
                  <label class="stat-label">Base</label>
                  <input type="number" class="stat-input" name="system.bonneaventure.base" value="{{system.bonneaventure.base}}" data-dtype="Number" {{#if isPlayMode}}disabled{{/if}} />
                </div>
                <div class="stat-item">
                  <label class="stat-label">Actuelle</label>
                  <input type="number" class="stat-input" name="system.bonneaventure.actuelle" value="{{system.bonneaventure.actuelle}}" data-dtype="Number" {{#if isPlayMode}}disabled{{/if}} />
                </div>
              </div>
            </div>

            <div class="stat-group">
              <h4 class="stat-title">{{localize "MNBL.eclat"}}</h4>
              <div class="stat-values">
                <div class="stat-item">
                  <input type="number" class="stat-input stat-input-single" name="system.eclat.value" value="{{system.eclat.value}}" data-dtype="Number" {{#if isPlayMode}}disabled{{/if}} />
                </div>
              </div>
            </div>


          </div>
        </div>
      </div>
    </div>
  </header>

  {{!-- Sheet Tab Navigation --}}
  <nav class="sheet-tabs tabs" data-group="primary">
    <a class="item" data-tab="principal">{{localize "MNBL.attributes"}}</a>
    <a class="item" data-tab="competences">{{localize "MNBL.skills"}}</a>
    <a class="item" data-tab="dons">{{localize "MNBL.abilities"}}</a>
    <a class="item" data-tab="equipement">{{localize "MNBL.equipment"}}</a>
    <a class="item" data-tab="biodata">{{localize "MNBL.bio"}}</a>
  </nav>

  {{!-- Sheet Body --}}
  <section class="sheet-body scrollable">

    {{!-- Main Tab --}}
    <div class="tab principal scrollable" data-group="primary" data-tab="principal">

      <div class="grid grid-2col">

        <div class="sheet-box color-bg-archetype">
          <div class="section-grid">
            <h4 class="section-title">{{localize "MNBL.attributes"}}</h4>
            {{#each system.attributs as |attr key|}}
            <div class="grid-row attr-row" data-attr-key="{{key}}">
              <img class="item-name-img" src="systems/fvtt-mournblade/assets/icons/{{attr.labelnorm}}.webp">
              <label class="label-name"><a data-action="rollAttribut" data-attr-key="{{key}}">{{localize attr.label}}</a></label>
              <select class="status-small-label color-class-common item-field-label-short" type="text"
                name="system.attributs.{{key}}.value" value="{{attr.value}}" data-dtype="Number" {{#if @root.isPlayMode}}disabled{{/if}}>
                {{selectOptions @root.config.listeNiveauSkill selected=attr.value}}
              </select>
            </div>
            {{/each}}
          </div>

          <div class="section-grid combat-grid">
            <h4 class="section-title">Combat</h4>
            <div class="grid-row combat-stat">
              <label class="stat-label">Initiative</label>
              <div class="stat-base">{{combat.initBase}}</div>
              <input type="number" class="input-numeric-short" name="system.combat.initbonus"
                value="{{system.combat.initbonus}}" data-tooltip="Bonus" data-dtype="Number" {{#if isPlayMode}}disabled{{/if}} />
              <div class="stat-total">= {{combat.initTotal}}</div>
            </div>

            <div class="grid-row combat-stat">
              <label class="stat-label">{{localize "MNBL.damagebonus"}}</label>
              <div class="stat-base">+{{combat.bonusDegats}}</div>
              <input type="number" class="input-numeric-short" name="system.combat.bonusdegats"
                value="{{system.combat.bonusdegats}}" data-tooltip="Bonus" data-dtype="Number" {{#if isPlayMode}}disabled{{/if}} />
              <div class="stat-total">= +{{combat.bonusDegatsTotal}}</div>
            </div>

            <div class="grid-row combat-stat">
              <label class="stat-label">{{localize "MNBL.speed"}}</label>
              <div class="stat-base">{{combat.vitesseBase}}</div>
              <input type="number" class="input-numeric-short" name="system.combat.vitessebonus"
                value="{{system.combat.vitessebonus}}" data-tooltip="Bonus" data-dtype="Number" {{#if isPlayMode}}disabled{{/if}} />
              <div class="stat-total">= {{combat.vitesseTotal}}</div>
            </div>

            <div class="grid-row combat-stat">
              <label class="stat-label">{{localize "MNBL.defense"}}</label>
              <div class="stat-base">{{combat.defenseBase}}</div>
              <input type="number" class="input-numeric-short" name="system.combat.defensebonus"
                value="{{system.combat.defensebonus}}" data-tooltip="Bonus" data-dtype="Number" {{#if isPlayMode}}disabled{{/if}} />
              <div class="stat-total">= {{combat.defenseTotal}}</div>
            </div>

            <div class="grid-row protection-row">
              <label class="stat-label">{{localize "MNBL.totalprotection"}}</label>
              <div class="protection-value">{{protectionTotal}}</div>
            </div>
          </div>

        </div>

        <div class="sheet-box color-bg-archetype">

          <div class="section-grid">
            <h4 class="section-title">{{localize "MNBL.health"}}</h4>
            <div class="grid-row">
              <label class="label-name">Total Santé</label>
              <div class="value-display">{{system.sante.base}}</div>
              <label class="label-name">{{localize "MNBL.bonus"}}</label>
              <input type="number" class="input-numeric-short" name="system.sante.bonus" {{#if isPlayMode}}disabled{{/if}} value="{{system.sante.bonus}}"
                data-dtype="Number" />
            </div>

            <div class="grid-row damage-row">
              <label class="label-name damage-label">{{localize "MNBL.nonlethal"}}</label>
              <div class="damage-controls">
                <a class="plus-minus-button" data-action="modifySante" data-type="nonletaux" data-value="-1">−</a>
                <input type="number" class="input-numeric-medium" name="system.sante.nonletaux" {{#if isPlayMode}}disabled{{/if}}
                  value="{{system.sante.nonletaux}}" data-dtype="Number" />
                <a class="plus-minus-button" data-action="modifySante" data-type="nonletaux" data-value="1">+</a>
              </div>
            </div>

            <div class="grid-row damage-row">
              <label class="label-name damage-label">{{localize "MNBL.lethal"}}</label>
              <div class="damage-controls">
                <a class="plus-minus-button" data-action="modifySante" data-type="letaux" data-value="-1">−</a>
                <input type="number" class="input-numeric-medium" name="system.sante.letaux" {{#if isPlayMode}}disabled{{/if}} value="{{system.sante.letaux}}"
                  data-dtype="Number" />
                <a class="plus-minus-button" data-action="modifySante" data-type="letaux" data-value="1">+</a>
              </div>
            </div>

            <div class="grid-row malus-row">
              <label class="label-name">{{localize "MNBL.malus"}}</label>
              <input type="number" class="input-numeric-short" name="system.sante.malusmanuel" {{#if isPlayMode}}disabled{{/if}}
                value="{{system.sante.malusmanuel}}" data-dtype="Number" />
              <label class="label-name">{{localize "MNBL.automalus"}}</label>
              <div class="malus-value">{{santeMalus}}</div>
            </div>
          </div>

          <div class="section-grid">
            <h4 class="section-title">{{localize "MNBL.soul"}}</h4>
            <div class="grid-row">
              <label class="label-name">Max Absolu</label>
              <input type="number" class="input-numeric-short" name="system.ame.fullmax" value="{{system.ame.fullmax}}"
                data-dtype="Number" {{#if isPlayMode}}disabled{{/if}} />
              <label class="label-name">{{localize "MNBL.currentmax"}}</label>
              <input type="number" class="input-numeric-short" name="system.ame.currentmax"
                value="{{system.ame.currentmax}}" data-dtype="Number" {{#if isPlayMode}}disabled{{/if}} />
            </div>

            <div class="grid-row soul-consumed-row">
              <label class="label-name">{{localize "MNBL.consumed"}}</label>
              <div class="damage-controls">
                <a class="plus-minus-button" data-action="modifyAme" data-value="-1">−</a>
                <input type="number" class="input-numeric-medium" name="system.ame.value" value="{{system.ame.value}}"
                  data-dtype="Number" {{#if isPlayMode}}disabled{{/if}} />
                <a class="plus-minus-button" data-action="modifyAme" data-value="1">+</a>
              </div>
            </div>

            <div class="grid-row soul-malus-row">
              <label class="label-name">{{localize "MNBL.automalus"}}</label>
              <div class="malus-value">{{ameMalus}}</div>
            </div>
          </div>
        </div>

      </div>

      <div>
        <div class="section-grid">
          <h4 class="section-title">{{localize "MNBL.modifier"}}</h4>
          <ul class="item-list compact-list">
            <li class="item flexrow list-item items-title-bg">
              <span class="item-name-label-header">{{localize "MNBL.modifier"}}</span>
              <span class="item-field-label-short">{{localize "MNBL.type"}}</span>
              <span class="item-field-label-short">{{localize "MNBL.value"}}</span>
              <div class="item-filler">&nbsp;</div>
              <div class="item-controls item-controls-fixed"></div>
            </li>
            {{#each modifiers as |modifier key|}}
            <li class="item flexrow " data-item-id="{{modifier._id}}" data-item-type="modifier">
              <img class="item-name-img" src="{{modifier.img}}" />
              <span class="item-name-label competence-name">{{modifier.name}}</span>
              <span class="item-field-label-short">{{upperFirst modifier.system.modifiertype}}</span>
              <span class="item-field-label-short">{{modifier.system.value}}</span>
              <div class="item-filler">&nbsp;</div>
              <div class="item-controls item-controls-fixed">
                <a data-action="editItem" title="Edit Item"><i class="fas fa-edit"></i></a>
                <a data-action="deleteItem" title="Delete Item"><i class="fas fa-trash"></i></a>
              </div>
            </li>
            {{/each}}
          </ul>
        </div>
      </div>

    </div>

    {{!-- Competence Tab --}}
    <div class="tab competences scrollable" data-group="primary" data-tab="competences">

      <div class="section-grid">
        <h4 class="section-title">{{localize "MNBL.skills"}}</h4>
        <ul class="item-list compact-list">
          <li class="item flexrow list-item items-title-bg">
            <span class="item-name-label-header">{{localize "MNBL.skills"}}</span>
            <span class="item-field-label-short">{{localize "MNBL.level"}}</span>
            <div class="item-filler">&nbsp;</div>
          </li>
            {{#each skills as |skill key|}}
            <li class="item flexrow " data-item-id="{{skill._id}}" data-item-type="competence">
              <img class="item-name-img" src="{{skill.img}}" />
              <div class="flexcol item-name-label">

                <span class="item-name-label competence-name"><a data-action="rollCompetence"
                    data-attr-key="tochoose">{{skill.name}}</a></span>

                <span class="predilection-text">
                  {{#each skill.system.predilections as |pred key|}}
                  {{pred.name}},
                  {{/each}}
                </span>
              </div>
              <select class="status-small-label color-class-common edit-item-data competence-niveau" type="text"
                data-item-field="niveau" data-dtype="Number" {{#if @root.isPlayMode}}disabled{{/if}}>
                {{selectOptions @root.config.listeNiveauSkill selected=skill.system.niveau}}
              </select>

              {{#if (ne skill.system.attribut1 "none")}}
              <span class="item-field-label-short">
                <button class="button-sheet-roll" data-action="rollCompetence" data-attr-key="{{skill.system.attribut1}}">{{upper
                  skill.system.attribut1}} : {{skill.system.attribut1total}}</button>
              </span>
              {{/if}}
              {{#if (ne skill.system.attribut2 "none")}}
              <span class="item-field-label-short">
                <button class="button-sheet-roll" data-action="rollCompetence" data-attr-key="{{skill.system.attribut2}}">{{upper
                  skill.system.attribut2}} : {{skill.system.attribut2total}}</button>
              </span>
              {{/if}}
              {{#if (ne skill.system.attribut3 "none")}}
              <span class="item-field-label-short">
                <button class="button-sheet-roll" data-action="rollCompetence" data-attr-key="{{skill.system.attribut3}}">{{upper
                  skill.system.attribut3}} : {{skill.system.attribut3total}}</button>
              </span>
              {{/if}}

              <div class="item-filler">&nbsp;</div>
              <div class="item-controls item-controls-fixed">
                <a data-action="editItem" title="Edit Item"><i class="fas fa-edit"></i></a>
                <a data-action="deleteItem" title="Delete Item"><i class="fas fa-trash"></i></a>
              </div>
            </li>
            {{/each}}
          </ul>
        </div>

    </div>

    {{!-- Dons/Pactes Tab --}}
    <div class="tab dons scrollable" data-group="primary" data-tab="dons">

      <div class="section-grid">
        <h4 class="section-title">{{localize "MNBL.gifts"}}</h4>
        <ul class="item-list compact-list">
          <li class="item flexrow list-item items-title-bg">
            <span class="item-name-label-header">{{localize "MNBL.gifts"}}</span>
            <span class="item-field-label-short">{{localize "MNBL.allegiance"}}</span>
            <div class="item-filler">&nbsp;</div>
            <div class="item-controls item-controls-fixed"></div>
          </li>
            {{#each dons as |don key|}}
            <li class="item flexrow " data-item-id="{{don._id}}" data-item-type="don">
              <img class="item-name-img" src="{{don.img}}" />
              <span class="item-name-label competence-name">{{don.name}}</span>
              <span class="item-field-label-short">&nbsp;{{upperFirst don.system.allegeance}}</span>
              <div class="item-filler">&nbsp;</div>
              <div class="item-controls item-controls-fixed">
                <a data-action="editItem" title="Edit Item"><i class="fas fa-edit"></i></a>
                <a data-action="deleteItem" title="Delete Item"><i class="fas fa-trash"></i></a>
              </div>
            </li>
            {{/each}}
          </ul>
        </div>

      <div class="section-grid">
        <h4 class="section-title">{{localize "MNBL.pacts"}}</h4>
        <ul class="item-list compact-list">
          <li class="item flexrow list-item items-title-bg">
            <span class="item-name-label-header">{{localize "MNBL.pacts"}}</span>
            <span class="item-field-label-short">{{localize "MNBL.allegiance"}}</span>
            <div class="item-filler">&nbsp;</div>
            <div class="item-controls item-controls-fixed"></div>
          </li>
            {{#each pactes as |pacte key|}}
            <li class="item flexrow " data-item-id="{{pacte._id}}" data-item-type="pacte">
              <img class="item-name-img" src="{{pacte.img}}" />
              <span class="item-name-label competence-name">{{pacte.name}}</span>
              <span class="item-field-label-short">{{upperFirst pacte.system.allegeance}}</span>
              <div class="item-filler">&nbsp;</div>
              <div class="item-controls item-controls-fixed">
                <a data-action="editItem" title="Edit Item"><i class="fas fa-edit"></i></a>
                <a data-action="deleteItem" title="Delete Item"><i class="fas fa-trash"></i></a>
              </div>
            </li>
            {{/each}}
          </ul>
          <div class="header-actions">
            <button class="chat-card-button" data-action="invoquerElementaire">
              <i class="fas fa-wind"></i> {{localize "MNBL.invoquerElementaire"}}
            </button>
            {{#if isChaotique}}
            <button class="chat-card-button" data-action="invoquerDemon">
              <i class="fas fa-skull"></i> {{localize "MNBL.invoquerDemon"}}
            </button>
            {{/if}}
            {{#if isLoyal}}
            <button class="chat-card-button" data-action="invoquerEsprit">
              <i class="fas fa-star"></i> {{localize "MNBL.invoquerEsprit"}}
            </button>
            {{/if}}
          </div>
        </div>

      <div class="section-grid">
        <h4 class="section-title">{{localize "MNBL.runes"}}</h4>
        <ul class="item-list compact-list">
          <li class="item flexrow list-item items-title-bg">
            <span class="item-name-label-header">{{localize "MNBL.runes"}}</span>
            <span class="item-field-label-long">{{upperFirst (localize "MNBL.highlanguage")}}</span>
            <span class="item-field-label-short">{{localize "MNBL.difficulty"}}</span>
            <div class="item-filler">&nbsp;</div>
            <div class="item-controls item-controls-fixed"></div>
          </li>
            {{#each runes as |rune key|}}
            <li class="item flexrow " data-item-id="{{rune._id}}" data-item-type="rune">
              <img class="item-name-img" src="{{rune.img}}" />
              <span class="item-name-label competence-name"><a data-action="rollRune">{{rune.name}}</a></span>
              <span class="item-field-label-long">{{rune.system.formule}}</span>
              <span class="item-field-label-short">{{rune.system.seuil}}</span>
              <div class="item-filler">&nbsp;</div>
              <div class="item-controls item-controls-fixed">
                <a data-action="editItem" title="Edit Item"><i class="fas fa-edit"></i></a>
                <a data-action="deleteItem" title="Delete Item"><i class="fas fa-trash"></i></a>
              </div>
            </li>
            {{/each}}
          </ul>
          <div class="header-actions">
            {{#if (gt runes.length 1)}}
            <button class="chat-card-button" data-action="rollSortilege">
              <i class="fas fa-layer-group"></i> Lancer un Sortilège
            </button>
            {{/if}}
            {{#if (gt runes.length 0)}}
            <button class="chat-card-button" data-action="preparePotion">
              <i class="fas fa-flask"></i> Préparer une Potion
            </button>
            {{/if}}
          </div>
        </div>

      {{!-- Invocations actives --}}
      {{#if (gt system.invocationsElementaires.length 0)}}
      <div class="section-grid">
        <h4 class="section-title">{{localize "MNBL.invocationsActives"}}</h4>
        <ul class="item-list compact-list">
          <li class="item flexrow list-item items-title-bg">
            <span class="item-name-label-header">{{localize "MNBL.invocationsActives"}}</span>
            <span class="item-field-label-short">{{localize "MNBL.invocationElement"}}</span>
            <span class="item-field-label-short">{{localize "MNBL.invocationTier"}}</span>
            <span class="item-field-label-short">{{localize "MNBL.invocationAmeBloque"}}</span>
            <div class="item-filler">&nbsp;</div>
            <div class="item-controls item-controls-fixed"></div>
          </li>
          {{#each system.invocationsElementaires as |invoc idx|}}
          <li class="item flexrow">
            <span class="item-name-label competence-name">{{invoc.actorName}}</span>
            <span class="item-field-label-short">{{invoc.element}}</span>
            <span class="item-field-label-short">{{invoc.tier}}</span>
            <span class="item-field-label-short">{{invoc.soulCost}}</span>
            <div class="item-filler">&nbsp;</div>
            <div class="item-controls item-controls-fixed">
              <a data-action="bannirElementaire" data-invoc-index="{{@index}}" title="{{localize 'MNBL.bannirElementaire'}}"><i class="fas fa-ban"></i></a>
            </div>
          </li>
          {{/each}}
        </ul>
      </div>
      {{/if}}

      {{!-- Invocations démoniaques actives --}}
      {{#if (gt system.invocationsDemons.length 0)}}
      <div class="section-grid">
        <h4 class="section-title">{{localize "MNBL.invocationsDemons"}}</h4>
        <ul class="item-list compact-list">
          <li class="item flexrow list-item items-title-bg">
            <span class="item-name-label-header">{{localize "MNBL.invocationsDemons"}}</span>
            <span class="item-field-label-short">{{localize "MNBL.invocationDemonAme"}}</span>
            <div class="item-filler">&nbsp;</div>
            <div class="item-controls item-controls-fixed"></div>
          </li>
          {{#each system.invocationsDemons as |invoc idx|}}
          <li class="item flexrow">
            <span class="item-name-label competence-name">{{invoc.demonName}}</span>
            <span class="item-field-label-short">{{invoc.soulCost}}</span>
            <div class="item-filler">&nbsp;</div>
            <div class="item-controls item-controls-fixed">
              <a data-action="libererDemon" data-invoc-index="{{@index}}" title="{{localize 'MNBL.libererDemon'}}"><i class="fas fa-door-open"></i></a>
            </div>
          </li>
          {{/each}}
        </ul>
      </div>
      {{/if}}


      <div class="section-grid">
        <h4 class="section-title">{{localize "MNBL.tendancies"}}</h4>
        <ul class="item-list compact-list">
          <li class="item flexrow list-item items-title-bg">
            <span class="item-name-label-header">{{localize "MNBL.tendancies"}}</span>
            <span class="item-field-label-short">{{localize "MNBL.allegiance"}}</span>
            <div class="item-filler">&nbsp;</div>
            <div class="item-controls item-controls-fixed"></div>
          </li>
            {{#each tendances as |tendance key|}}
            <li class="item flexrow " data-item-id="{{tendance._id}}" data-item-type="tendance">
              <img class="item-name-img" src="{{tendance.img}}" />
              <span class="item-name-label competence-name">{{tendance.name}}</span>
              <span class="item-field-label-short">{{tendance.system.allegeance}}</span>
              <div class="item-filler">&nbsp;</div>
              <div class="item-controls item-controls-fixed">
                <a data-action="editItem" title="Edit Item"><i class="fas fa-edit"></i></a>
                <a data-action="deleteItem" title="Delete Item"><i class="fas fa-trash"></i></a>
              </div>
            </li>
            {{/each}}
          </ul>
        </div>

      <div class="section-grid">
        <h4 class="section-title">{{localize "MNBL.chaotictraits"}}</h4>
        <ul class="item-list compact-list">
          <li class="item flexrow list-item items-title-bg">
            <span class="item-name-label-header">{{localize "MNBL.chaotictraits"}}</span>
            <div class="item-filler">&nbsp;</div>
            <div class="item-controls item-controls-fixed"></div>
          </li>
            {{#each traitsChaotiques as |trait key|}}
            <li class="item flexrow " data-item-id="{{trait._id}}" data-item-type="traitchaotique">
              <img class="item-name-img" src="{{trait.img}}" />
              <span class="item-name-label competence-name">{{trait.name}}</span>
              <div class="item-filler">&nbsp;</div>
              <div class="item-controls item-controls-fixed">
                <a data-action="editItem" title="Edit Item"><i class="fas fa-edit"></i></a>
                <a data-action="deleteItem" title="Delete Item"><i class="fas fa-trash"></i></a>
              </div>
            </li>
            {{/each}}
          </ul>
        </div>

        <div class="section-grid">
          <h4 class="section-title">{{localize "MNBL.activatedrunes"}}</h4>
          <ul class="item-list compact-list">
            <li class="item flexrow list-item items-title-bg">
              <span class="item-name-label-header">{{localize "MNBL.activatedrunes"}}</span>
              <span class="item-field-label-long">
                <label class="short-label">{{localize "MNBL.rune"}}</label>
              </span>
              <span class="item-field-label-short">
                <label class="short-label">{{localize "MNBL.mode"}}</label>
              </span>
              <span class="item-field-label-medium">
                <label class="short-label">{{localize "MNBL.duration"}}.</label>
              </span>
              <span class="item-field-label-short">
                <label class="short-label">{{localize "MNBL.soul"}}</label>
              </span>
              <div class="item-filler">&nbsp;</div>
              <div class="item-controls item-controls-fixed">
              </div>
            </li>
            {{#each runeEffects as |runeEffect key|}}
            <li class="item flexrow " data-item-id="{{runeEffect._id}}" data-item-type="runeeffect">
              <img class="item-name-img" src="{{runeEffect.img}}" />
              <span class="item-name-label competence-name">{{runeEffect.name}}</span>
              <span class="item-field-label-long">{{runeEffect.system.rune}}</span>
              <span class="item-field-label-short">{{upperFirst runeEffect.system.mode}}</span>
              <span class="item-field-label-medium">{{runeEffect.system.duree}}</span>
              <span class="item-field-label-short">{{runeEffect.system.pointame}}</span>
              <div class="item-filler">&nbsp;</div>
              <div class="item-controls item-controls-fixed">
                <a data-action="editItem" title="Edit Item"><i class="fas fa-edit"></i></a>
                <a data-action="deleteItem" title="Delete Item"><i class="fas fa-trash"></i></a>
              </div>
            </li>
            {{/each}}
          </ul>
        </div>

      </div>

    </div>


    {{!-- Equipement Tab --}}
    <div class="tab equipement scrollable" data-group="primary" data-tab="equipement">

      <div class="section-grid">
        <h4 class="section-title">{{localize "MNBL.treasuremoney"}}</h4>
        <ul class="item-list compact-list">
          <li class="item flexrow list-item items-title-bg">
            <span class="item-name-label-header">{{localize "MNBL.treasuremoney"}}</span>
            <span class="item-field-label-medium">{{localize "MNBL.quantity"}}</span>
            <span class="item-field-label-medium">{{localize "MNBL.unit"}}</span>
            <div class="item-filler">&nbsp;</div>
            <div class="item-controls item-controls-fixed">
              <a data-action="createItem" data-type="monnaie" title="Ajouter une monnaie"><i
                  class="fas fa-plus"></i></a>
            </div>
          </li>
            {{#each monnaies as |monnaie key|}}
            <li class="item flexrow " data-item-id="{{monnaie._id}}" data-item-type="monnaie">
              <img class="item-name-img" src="{{monnaie.img}}" />
              <span class="item-name-label competence-name">{{monnaie.name}}</span>
              <span class="item-name-label competence-name item-field-label-medium">{{monnaie.system.quantite}}
                <a class="plus-minus-button" data-action="modifyQuantity" data-quantite-value="-1">-</a>
                <a class="plus-minus-button" data-action="modifyQuantity" data-quantite-value="1">+</a>
              </span>
              <span class="item-name-label competence-name item-field-label-medium">{{monnaie.system.unite}}</span>
              <div class="item-filler">&nbsp;</div>
              <div class="item-controls item-controls-fixed">
                <a data-action="editItem" title="Edit Item"><i class="fas fa-edit"></i></a>
                <a data-action="deleteItem" title="Delete Item"><i class="fas fa-trash"></i></a>
              </div>
            </li>
            {{/each}}
          </ul>
        </div>

      <div class="section-grid">
        <h4 class="section-title">{{localize "MNBL.specialactions"}}</h4>
        <div class="action-buttons-row">
          <button class="button-sheet-roll button-sheet-roll-large" data-action="rollAssommer">{{localize "MNBL.knockout"}}</button>
          <button class="button-sheet-roll button-sheet-roll-large" data-action="rollFuir">{{localize "MNBL.flee"}}</button>
          <button class="button-sheet-roll button-sheet-roll-large" data-action="rollImmobiliser">{{localize "MNBL.immobilize"}}</button>
          <div class="mounted-checkbox">
            <label class="label-name">{{localize "MNBL.mounted"}} ?</label>
            <input type="checkbox" name="system.combat.monte" {{checked system.combat.monte}} />
          </div>
        </div>
      </div>

      <div class="section-grid">
        <h4 class="section-title">{{localize "MNBL.weapons"}}</h4>
        <ul class="item-list compact-list">
          <li class="item flexrow list-item items-title-bg">
            <span class="item-name-label-header">{{localize "MNBL.weapons"}}</span>
            <span class="item-field-label-short">{{localize "MNBL.attack"}}</span>
            <span class="item-field-label-short">{{localize "MNBL.defense"}}</span>
            <span class="item-field-label-short">{{localize "MNBL.damage"}}</span>
            <div class="item-filler">&nbsp;</div>
            <div class="item-controls item-controls-fixed">
              <a data-action="createItem" data-type="arme" title="Ajouter une arme"><i
                  class="fas fa-plus"></i></a>
            </div>
          </li>
            {{#each armes as |arme key|}}
            <li class="item flexrow " data-item-id="{{arme._id}}" data-item-type="arme">
              <img class="item-name-img" src="{{arme.img}}" />
              <span class="item-name-label competence-name">{{arme.name}}</span>

              <span class="item-field-label-short">
                {{#if arme.system.equipped}}
                <button class="button-sheet-roll" data-action="rollArmeOffensif" data-arme-id="{{arme._id}}">{{arme.system.totalOffensif}}</button>
                {{else}}
                <button disabled class="button-sheet-roll-offline">{{arme.system.totalOffensif}}</button>
                {{/if}}
              </span>

              {{#if arme.system.isdefense}}
              <span class="item-field-label-short arme-defensif"><label
                  class="arme-defensif">{{arme.system.totalDefensif}}</label></span>
              {{else}}
              <span class="item-field-label-short arme-defensif"><label class="arme-defensif">-</label></span>
              {{/if}}

              <span class="item-field-label-short">
                {{#if arme.system.equipped}}
                <button class="button-sheet-roll" data-action="rollArmeDegats" data-arme-id="{{arme._id}}">{{arme.system.totalDegats}}</button>
                {{else}}
                <button disabled class="button-sheet-roll-offline">{{arme.system.totalDegats}}</button>
                {{/if}}
              </span>

              <div class="item-filler">&nbsp;</div>
              <div class="item-controls item-controls-fixed">
                {{#if arme.system.enchantementLoi.actif}}<a title="Enchanté (Loi)" style="color:gold;"><i class="fas fa-star"></i></a>{{else if ../isLoyal}}<a data-action="enchanter" data-item-id="{{arme._id}}" title="Enchanter (Loi)"><i class="fas fa-star-half-alt"></i></a>{{/if}}
                <a data-action="equipItem" title="Worn">{{#if arme.system.equipped}}<i
                    class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
                <a data-action="editItem" title="Edit Item"><i class="fas fa-edit"></i></a>
                <a data-action="deleteItem" title="Delete Item"><i class="fas fa-trash"></i></a>
              </div>
            </li>
            {{/each}}
          </ul>
        </div>

      <div class="section-grid">
        <h4 class="section-title">{{localize "MNBL.Protections"}}</h4>
        <ul class="item-list compact-list">
          <li class="item flexrow list-item items-title-bg">
            <span class="item-name-label-header">{{localize "MNBL.Protections"}}</span>
            <span class="item-field-label-short">Protection</span>
            <div class="item-filler">&nbsp;</div>
            <div class="item-controls item-controls-fixed">
              <a data-action="createItem" data-type="protection" title="Ajouter une protection"><i
                  class="fas fa-plus"></i></a>
            </div>
          </li>
            {{#each protections as |protection key|}}
            <li class="item flexrow " data-item-id="{{protection._id}}" data-item-type="protection">
              <img class="item-name-img" src="{{protection.img}}" />
              <span class="item-name-label competence-name">{{protection.name}}</span>
              <span class="item-field-label-short arme-defensif"><label
                  class="arme-defensif">{{protection.system.protection}}</label>
              </span>
              <div class="item-filler">&nbsp;</div>
              <div class="item-controls item-controls-fixed">
                {{#if protection.system.enchantementLoi.actif}}<a title="Enchanté (Loi)" style="color:gold;"><i class="fas fa-star"></i></a>{{else if ../isLoyal}}<a data-action="enchanter" data-item-id="{{protection._id}}" title="Enchanter (Loi)"><i class="fas fa-star-half-alt"></i></a>{{/if}}
                <a data-action="equipItem" title="Worn">{{#if protection.system.equipped}}<i
                    class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
                <a data-action="editItem" title="Edit Item"><i class="fas fa-edit"></i></a>
                <a data-action="deleteItem" title="Delete Item"><i class="fas fa-trash"></i></a>
              </div>
            </li>
            {{/each}}
          </ul>
        </div>

      <div class="section-grid">
        <h4 class="section-title">{{localize "MNBL.equipments"}}</h4>
        <ul class="item-list compact-list">
          <li class="item flexrow list-item items-title-bg">
            <span class="item-name-label-header">{{localize "MNBL.equipments"}}</span>
            <div class="item-filler">&nbsp;</div>
            <div class="item-controls item-controls-fixed">
              <a data-action="createItem" data-type="equipement" title="Ajouter un équipement"><i
                  class="fas fa-plus"></i></a>
            </div>
          </li>
            {{#each equipements as |equipement key|}}
            <li class="item flexrow " data-item-id="{{equipement._id}}" data-item-type="equipement">
              <img class="item-name-img" src="{{equipement.img}}" />
              <span class="item-name-label competence-name">{{equipement.name}}</span>
              <div class="item-filler">&nbsp;</div>
              <div class="item-controls item-controls-fixed">
                {{#if equipement.system.enchantementLoi.actif}}<a title="Enchanté (Loi)" style="color:gold;"><i class="fas fa-star"></i></a>{{else if ../isLoyal}}<a data-action="enchanter" data-item-id="{{equipement._id}}" title="Enchanter (Loi)"><i class="fas fa-star-half-alt"></i></a>{{/if}}
                <a data-action="editItem" title="Edit Item"><i class="fas fa-edit"></i></a>
                <a data-action="deleteItem" title="Delete Item"><i class="fas fa-trash"></i></a>
              </div>
            </li>
            {{/each}}
          </ul>
        </div>

      <div class="section-grid">
        <h4 class="section-title">{{localize "MNBL.potions"}}</h4>
        <ul class="item-list compact-list">
          <li class="item flexrow list-item items-title-bg">
            <span class="item-name-label-header">{{localize "MNBL.potions"}}</span>
            <span class="item-field-label-short">{{localize "MNBL.potionStatut"}}</span>
            <span class="item-field-label-short">{{localize "MNBL.potionDuree"}}</span>
            <div class="item-filler">&nbsp;</div>
            <div class="item-controls item-controls-fixed">
              <a data-action="createItem" data-type="potion" title="Ajouter une potion"><i class="fas fa-plus"></i></a>
            </div>
          </li>
            {{#each potions as |potion key|}}
            <li class="item flexrow" data-item-id="{{potion._id}}" data-item-type="potion">
              <img class="item-name-img" src="{{potion.img}}" />
              <span class="item-name-label competence-name">{{potion.name}}</span>
              <span class="item-field-label-short">{{upperFirst potion.system.statut}}</span>
              <span class="item-field-label-short">{{potion.system.duree}}</span>
              <div class="item-filler">&nbsp;</div>
              <div class="item-controls item-controls-fixed">
                <a data-action="editItem" title="Edit Item"><i class="fas fa-edit"></i></a>
                <a data-action="deleteItem" title="Delete Item"><i class="fas fa-trash"></i></a>
              </div>
            </li>
            {{/each}}
          </ul>
        </div>

      </div>

    </div>


    {{!-- Biography Tab --}}
    <div class="tab biodata" data-group="primary" data-tab="biodata">

      <div class="section-grid">
        <h4 class="section-title">{{localize "MNBL.identity"}}</h4>
        <div class="grid grid-3col" style="gap: 0.5rem; margin: 0;">
          <div>
            <ul class="item-list compact-list">
              <li class="item flexrow" data-item-id="{{origine._id}}" data-tooltip="{{localize "MNBL.origin"}}">
                <label class="label-name">{{origine.name}}</label>
                <div class="item-controls item-controls-fixed">
                  <a data-action="editItem" title="Edit Item"><i class="fas fa-edit"></i></a>
                  <a data-action="deleteItem" title="Delete Item"><i class="fas fa-trash"></i></a>
                </div>
              </li>
              <li class="item flexrow" data-item-id="{{heritage._id}}" data-tooltip="{{localize "MNBL.legacy"}}">
                <label class="label-name">{{heritage.name}}</label>
                <div class="item-controls item-controls-fixed">
                  <a data-action="editItem" title="Edit Item"><i class="fas fa-edit"></i></a>
                  <a data-action="deleteItem" title="Delete Item"><i class="fas fa-trash"></i></a>
                </div>
              </li>
              <li class="item flexrow" data-item-id="{{metier._id}}" data-tooltip="{{localize "MNBL.profession"}}">
                <label class="label-name">{{metier.name}}</label>
                <div class="item-controls item-controls-fixed">
                  <a data-action="editItem" title="Edit Item"><i class="fas fa-edit"></i></a>
                  <a data-action="deleteItem" title="Delete Item"><i class="fas fa-trash"></i></a>
                </div>
              </li>
            </ul>
          </div>

          <div>
            <ul class="item-list compact-list">
              <li class="item flexrow">
                <label class="label-name">Age</label>
                <input type="text" class="" name="system.biodata.age" value="{{system.biodata.age}}" data-dtype="String" />
              </li>
              <li class="item flexrow">
                <label class="label-name">{{localize "MNBL.size"}}</label>
                <input type="text" class="" name="system.biodata.size" value="{{system.biodata.size}}"
                  data-dtype="String" />
              </li>
              <li class="item flexrow">
                <label class="label-name">{{localize "MNBL.hair"}}</label>
                <input type="text" class="" name="system.biodata.hair" value="{{system.biodata.hair}}"
                  data-dtype="String" />
              </li>
              <li class="flexrow item">
                <label class="label-name">{{localize "MNBL.genre"}}</label>
                <input type="text" class="" name="system.biodata.sex" value="{{system.biodata.sex}}" data-dtype="String" />
              </li>
              <li class="flexrow item">
                <label class="label-name">{{localize "MNBL.exp"}}</label>
                <input type="number" class="" name="system.experience.value" {{#if isPlayMode}}disabled{{/if}} value="{{system.experience.value}}" data-dtype="Number" />
              </li>
            </ul>
          </div>

          <div>
            <ul class="item-list compact-list">
              <li class="item flexrow">
                <label class="label-name">{{localize "MNBL.eyes"}}</label>
                <input type="text" class="" name="system.biodata.eyes" value="{{system.biodata.eyes}}"
                  data-dtype="String" />
              </li>
              <li class="flexrow item">
                <label class="label-name">{{localize "MNBL.weight"}}</label>
                <input type="text" class="" name="system.biodata.weight" value="{{system.biodata.weight}}"
                  data-dtype="String" />
              </li>
              <li class="flexrow item">
                <label class="label-name">{{localize "MNBL.preferredhand"}}</label>
                <input type="text" class="" name="system.biodata.preferredhand" value="{{system.biodata.preferredhand}}"
                  data-dtype="String" />
              </li>
            </ul>
          </div>
        </div>
      </div>

      {{#if isGM}}
      <div class="section-grid gm-tools-section">
        <h4 class="section-title">{{localize "MNBL.gmtools"}}</h4>
        <div class="grid grid-2col" style="gap: 0.5rem; margin: 0;">
          <div>
            <ul class="item-list compact-list">
              <li class="flexrow item">
                <label class="label-name ">{{localize "MNBL.soulmultiplier"}}</label>
                <input type="text" class="input-numeric-short" name="system.biodata.amemultiplier"
                  value="{{system.biodata.amemultiplier}}" data-dtype="Number" />
              </li>
            </ul>
          </div>
          <div>
            <ul class="item-list compact-list">
              <li class="flexrow item">
                <label class="label-name">{{localize "MNBL.ignorehealthmalus"}} ?</label>
                <input type="checkbox" name="system.biodata.ignoresantemalus" {{checked system.biodata.ignoresantemalus}} />
              </li>
              <li class="flexrow item">
                <label class="label-name">{{localize "MNBL.ignoresoulmalus"}} ?</label>
                <input type="checkbox" name="system.biodata.ignoreamemalus" {{checked system.biodata.ignoreamemalus}} />
              </li>
            </ul>
          </div>
        </div>
      </div>
      {{/if}}

      <div class="section-grid">
        <h4 class="section-title">Description</h4>
        <div class="medium-editor item-text-long-line">

          {{formInput systemFields.biodata.fields.description enriched=enrichedDescription value=system.biodata.description name="system.biodata.description" toggled=true}}

        </div>
      </div>

    </div>

  </section>
</section>