<section aria-labelledby="empire-ledger-title" data-tab-panel data-tab-id="mando-libro-mayor" data-tab-label="Libro mayor">
  <div class="section-heading-with-tools"><div><p class="eyebrow">VISIÓN DE CONJUNTO</p><h2 id="empire-ledger-title" class="section-title">Libro mayor imperial</h2></div><label for="ledger-filter">Filtrar planetas<input id="ledger-filter" type="search" autocomplete="off" data-ledger-filter aria-describedby="ledger-filter-status"></label></div>
  <p id="ledger-filter-status" role="status" aria-live="polite">Mostrando {{ ledger|length }} {{ 'planeta' if ledger|length == 1 else 'planetas' }}.</p>
  <div class="table-wrap"><table class="strategic-ledger"><caption>Recursos, producción, ecología, fuerzas y automatización de todas tus colonias.</caption>
    <thead><tr><th scope="col">Planeta</th><th scope="col">Recursos</th><th scope="col">Producción por hora</th><th scope="col">Población y alimento</th><th scope="col">Energía y ecología</th><th scope="col">Fuerzas</th><th scope="col">Cola y mandato</th></tr></thead>
    <tbody>{% for row in ledger %}<tr data-ledger-row>
      <th scope="row"><a href="{{ url_for('game_view', section='overview', planet=row.planet.id) }}">{{ row.planet.name }}</a><small>[{{ row.planet.galaxy }}:{{ row.planet.system }}:{{ row.planet.position }}] · {{ POLICIES[row.planet.policy].name }}</small></th>
      <td>Metal {{ row.snap.resources.metal|number }}<br>Cristal {{ row.snap.resources.crystal|number }}<br>Deuterio {{ row.snap.resources.deuterium|number }}</td>
      <td>Metal +{{ (row.snap.rates.metal * game.speed)|number }}<br>Cristal +{{ (row.snap.rates.crystal * game.speed)|number }}<br>Deuterio +{{ (row.snap.rates.deuterium * game.speed)|number }}</td>
      <td>{{ row.snap.population|number }} habitantes<br>{{ row.snap.food|number }} alimentos<br>Moral {{ row.snap.morale|round|int }} %</td>
      <td>Energía {{ (row.snap.rates.energy_ratio * 100)|round|int }} %<br>Contaminación {{ row.planet.pollution|round|int }} %<br>Habitabilidad {{ row.planet.habitability|round|int }} %</td>
      <td>{{ row.ships|number }} naves<br>{{ row.defenses|number }} defensas</td>
      <td>{% if row.queue %}{% set queued_definition = BUILDINGS.get(row.queue.item) or TECHNOLOGIES.get(row.queue.item) or SHIPS.get(row.queue.item) or DEFENSES.get(row.queue.item) %}{{ queued_definition.name if queued_definition else row.queue.item }}{% else %}Sin cola{% endif %}<br>{% if row.governor %}{{ 'Activo' if row.governor.enabled else 'Inactivo' }} · {{ DEVELOPMENT_PLANS[row.governor.plan_key].name }}{% else %}Sin gobernador{% endif %}</td>
    </tr>{% endfor %}</tbody>
  </table></div>
</section>
