{* Variables tab — group-wide key/value map substituted into templates.
   Storage: puqWebHosting_server_groups.dns_vars (JSON). Used by:
     - zonePlaceholders() in dns.addZone worker — every {key} in zone
       template records is replaced with the matching value (or falls
       through to WHMCS configOptions, then empty).
   Default slots: ns1, ns2. Admin can add any custom variable via "Add
   variable". Key must match ^[a-zA-Z][a-zA-Z0-9_]*$ — these become
   {key} placeholders. *}

{if $is_new}
    <div class="alert alert-info">
        <i class="fa fa-info-circle"></i> Save the group first (General tab), then you can define variables.
    </div>
{else}
<div class="puq-vars-tab">
    <p class="text-muted small">
        Group-wide key/value pairs substituted into DNS zone template records as
        <code>{literal}{name}{/literal}</code> placeholders. Empty values fall through
        to the product's WHMCS configoptions; if both are empty, the worker drops
        template records that reference the variable.
    </p>
    <div class="row" id="puq-vars-grid">
        <div class="col-md-12 text-muted text-center" style="padding:20px;">
            <i class="fa fa-spinner fa-spin"></i> Loading…
        </div>
    </div>
    <div style="margin-top:10px;">
        <button type="button" class="btn btn-default btn-sm" id="puq-vars-add"><i class="fa fa-plus"></i> Add variable</button>
        <button type="button" class="btn btn-primary btn-sm pull-right" id="puq-vars-save"><i class="fa fa-save"></i> Save variables</button>
        <div class="clearfix"></div>
    </div>
</div>
{/if}
