<form class="{{cssClass}}" autocomplete="off">
  <header class="sheet-header">
    <img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
    <div class="header-fields">
      <h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name"/></h1>
    </div>
  </header>

  {{!-- Sheet Tab Navigation --}}
  <nav class="sheet-tabs tabs" data-group="primary">
    <a class="item" data-tab="description">Description</a>
    <a class="item" data-tab="attributes">Attributes</a>
    <a class="item" data-tab="effects">Effects</a>
  </nav>

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

    {{!-- Description Tab --}}
    <div class="tab" data-group="primary" data-tab="description">
      {{!-- Editors must receive enriched text data from getData to properly handle rolls --}}
      {{editor enrichedDescription target="system.description" engine="prosemirror" button=true editable=editable}}
    </div>

    {{!-- Attributes Tab --}}
    <div class="tab attributes" data-group="primary" data-tab="attributes">
      {{!-- Grade de compétence (I à V) avec pips cliquables --}}
      <div class="form-group">
        <label>{{localize "MYRIAD_SYSTEM.ItemAttributes.Grade"}}</label>
        <div class="form-fields">
          <div class="item-grade grade-pips">
            {{#times 5}}
            <i class="grade-pip fas {{#if (lte (toNumber this) (toNumber ../system.grade))}}fa-circle{{else}}fa-circle-o{{/if}}"
               data-grade="{{this}}"></i>
            {{/times}}
            <span class="grade-value">{{localize (concat "MYRIAD_SYSTEM.Grade." (numberToRoman system.grade))}}</span>
            <input type="hidden" name="system.grade" value="{{system.grade}}" data-dtype="Number"/>
          </div>
        </div>
      </div>

      {{!-- Capacité passive --}}
      <div class="form-group">
        <label>{{localize "MYRIAD_SYSTEM.ItemAttributes.IsPassive"}}</label>
        <div class="form-fields">
          <input type="checkbox" name="system.isPassive" {{checked system.isPassive}}/>
        </div>
      </div>
      
      {{!-- Tags --}}
      <div class="form-group">
        <label>{{localize "MYRIAD_SYSTEM.ItemAttributes.Tags"}}</label>
        <div class="form-fields">
          <input type="text" name="system.tags" value="{{system.tags}}" data-dtype="String"/>
          <p class="hint">{{localize "MYRIAD_SYSTEM.ItemAttributes.TagsHint"}}</p>
        </div>
      </div>
      
      {{!-- Acquisition --}}
      <h3>{{localize "MYRIAD_SYSTEM.ItemAttributes.Acquisition"}}</h3>
      
      {{!-- Coût en XP --}}
      <div class="form-group">
        <label>{{localize "MYRIAD_SYSTEM.Acquisition.xpCost"}}</label>
        <div class="form-fields">
          <input type="number" name="system.acquisition.xpCost" value="{{system.acquisition.xpCost}}" data-dtype="Number"/>
        </div>
      </div>
      
      {{!-- Prérequis --}}
      <div class="form-group stacked">
        <label>{{localize "MYRIAD_SYSTEM.Acquisition.prerequisites"}}</label>
        <a class="add-prerequisite" title="{{localize 'MYRIAD_SYSTEM.UI.AddPrerequisite'}}"><i class="fas fa-plus"></i></a>
        <ol class="prerequisites-list">
          {{#each system.acquisition.prerequisites as |prerequisite i|}}
          <li class="prerequisite">
            <input type="text" name="system.acquisition.prerequisites.{{i}}" value="{{prerequisite}}" />
            <a class="delete-prerequisite" data-index="{{i}}" title="{{localize 'MYRIAD_SYSTEM.UI.Delete'}}"><i class="fas fa-trash"></i></a>
          </li>
          {{/each}}
        </ol>
      </div>
    </div>

    {{!-- Effects Tab --}}
    <div class="tab effects" data-group="primary" data-tab="effects">
      {{> "systems/myriad-system/templates/item/parts/item-effects.hbs"}}
    </div>
  </section>

</form>
