<div class="tab resources sheet-part {{#if @root.tabs.resources.active}}active{{/if}}" data-group="sheet" data-tab="resources">
  <section class="community-section">
    <h3>{{ localize 'COMMUNITY.reserves' }}</h3>
    <div class="grid grid-3col">
      <div class="form-group">
        <label for="system.reserve.value">{{ localize 'COMMUNITY.group_reserve' }}</label>
        {{#if isEditMode}}
        <input type="number" name="system.reserve.value" value="{{system.reserve.value}}" data-dtype="Number" min="0" max="{{system.reserve.max}}" />
        {{else}}
        <span>{{system.reserve.value}} / {{system.reserve.max}}</span>
        {{/if}}
      </div>
      <div class="form-group">
        <label for="system.material">{{ localize 'COMMUNITY.material_dice' }}</label>
        {{#if isEditMode}}
        <input type="number" name="system.material" value="{{system.material}}" data-dtype="Number" min="0" />
        {{else}}
        <span>{{system.material}}D</span>
        {{/if}}
      </div>
      <div class="form-group">
        <label for="system.experience.dice">{{ localize 'COMMUNITY.experience_dice' }}</label>
        {{#if isEditMode}}
        <input type="number" name="system.experience.dice" value="{{system.experience.dice}}" data-dtype="Number" min="0" />
        {{else}}
        <span>{{system.experience.dice}}D</span>
        {{/if}}
      </div>
    </div>
  </section>

  <section class="community-section">
    <h3>{{ localize 'COMMUNITY.morale' }}</h3>
    <div class="flexrow">
      <div class="form-group" style="flex: 1;">
        <label for="system.morale.value">{{ localize 'COMMUNITY.morale_value' }}</label>
        {{#if isEditMode}}
        <input type="number" name="system.morale.value" value="{{system.morale.value}}" data-dtype="Number" min="0" max="7" />
        {{else}}
        <span>{{system.morale.value}}</span>
        {{/if}}
      </div>
      <div class="form-group" style="flex: 1;">
        <label>{{ localize 'COMMUNITY.morale_state' }}</label>
        <span class="morale-level {{ system.morale.level }}">{{ localize (concat 'COMMUNITY.morale_levels.' system.morale.level) }}</span>
      </div>
    </div>
    {{#if system.allDomainsLow}}
    <p class="community-warning">{{ localize 'COMMUNITY.morale_blocked' }}</p>
    {{/if}}
  </section>

  <section class="community-section">
    <h3>{{ localize 'COMMUNITY.habitants_title' }}</h3>
    <p class="community-hint">{{ localize 'COMMUNITY.habitants_coming' }}</p>
    {{#if resolvedGroup}}
    <p class="community-linked-group">
      <span class="label">{{ localize 'COMMUNITY.linked_group' }}:</span>
      <span class="value">{{ resolvedGroup.name }}</span>
    </p>
    {{/if}}
  </section>
</div>
