{# Diff result fragment — loaded into diff modal body #}
{% if validation_error %}
<div class="cfg-banner error">{{ validation_error }}</div>
<input type="hidden" id="diff-has-errors" value="1">
{% endif %}
{% if error %}
<div class="cfg-banner error">{{ error }}</div>
{% elif changes %}
<div class="cfg-diff-summary">
  {{ total_changes }} change{{ 's' if total_changes != 1 else '' }}
  {% if has_server_scope %} — <strong>server reload pending until idle</strong>{% endif %}
  {% for scope_name, count in scope_summary.items() %}
  <span class="cfg-scope cfg-{{ scope_name }}">{{ scope_name }}: {{ count }}</span>
  {% endfor %}
</div>
<table class="cfg-diff-table">
  <thead>
    <tr>
      <th>Field</th>
      <th>Scope</th>
      <th>Before</th>
      <th>After</th>
    </tr>
  </thead>
  <tbody>
    {% for change in changes %}
    <tr>
      <td>{{ change.field }}</td>
      <td><span class="cfg-scope cfg-{{ change.scope }}">{{ change.scope }}</span></td>
      <td class="cfg-diff-old">{{ change.old }}</td>
      <td class="cfg-diff-new">{{ change.new }}</td>
    </tr>
    {% endfor %}
  </tbody>
</table>
{% elif not validation_error %}
<div class="cfg-banner info">No changes to save.</div>
{% endif %}
