{* Standard files tab — predefined slots (error pages, suspend, index/robots).
   Each row: Override (open editor), Pull (server picker + preview).
   Loaded lazily via renderGroupEditTab. *}
{if $is_new}
    <div class="alert alert-info"><i class="fa fa-info-circle"></i> Save the group first to manage files.</div>
{else}
    <p class="text-muted small">
        Standard Hestia files that admins commonly rebrand. Each row maps to a known path under
        <code>/usr/local/hestia/data/templates/</code>. Click <em>Override</em> to start managing a slot
        — paste/edit the new content and save. <em>Pull</em> imports the current content from a server
        of your choice, with a preview before importing.
    </p>
    <div class="alert alert-info" style="padding:6px 12px;margin-bottom:10px;">
        <i class="fa fa-info-circle"></i>
        <strong>Web servers only.</strong> "Apply standard files" only pushes to type=web servers in the group;
        mail servers do not have a <code>data/templates/web/</code> tree and are skipped.
    </div>
    {foreach from=$standard_file_groups key=gslug item=grp}
        <div class="panel panel-default">
            <div class="panel-heading"><h4 class="panel-title">{$grp.label}</h4></div>
            <div class="panel-body" style="padding:0;">
                <p class="text-muted small" style="padding:8px 12px;margin:0;border-bottom:1px solid #eee;background:#fcfcfc;">{$grp.description}</p>
                <div data-stdgroup="{$gslug}">
                    {foreach from=$grp.slots item=slot}
                        <div class="puq-stdfile-row" data-cat="{$slot.category}" data-rel="{$slot.rel_path}" data-mode="{$slot.mode}">
                            <div class="meta">
                                <span class="label-text">{$slot.label}</span><br>
                                <code>/usr/local/hestia/data/templates/{$slot.category}/{$slot.rel_path}</code>
                            </div>
                            <div class="status">
                                <span class="puq-stdfile-status default">default</span>
                            </div>
                            <div class="actions">
                                <button type="button" class="btn btn-xs btn-success puq-std-override"><i class="fa fa-pencil-alt"></i> Override</button>
                                <button type="button" class="btn btn-xs btn-info puq-std-pull" title="Pick a server, preview file content, then import"><i class="fa fa-download"></i> Pull</button>
                            </div>
                        </div>
                    {/foreach}
                </div>
            </div>
        </div>
    {/foreach}
{/if}
