<div class="foxblock-fim-summary">
    <div class="foxblock-fim-stat foxblock-fim-stat--modified">
        <span class="foxblock-fim-count"><?php echo count($results['modified']); ?></span>
        <span class="foxblock-fim-label">Đã sửa</span>
    </div>
    <div class="foxblock-fim-stat foxblock-fim-stat--added">
        <span class="foxblock-fim-count"><?php echo count($results['added']); ?></span>
        <span class="foxblock-fim-label">Thêm mới</span>
    </div>
    <div class="foxblock-fim-stat foxblock-fim-stat--deleted">
        <span class="foxblock-fim-count"><?php echo count($results['deleted']); ?></span>
        <span class="foxblock-fim-label">Đã xóa</span>
    </div>
    <div class="foxblock-fim-stat foxblock-fim-stat--clean">
        <span class="foxblock-fim-count"><?php echo intval($total); ?></span>
        <span class="foxblock-fim-label"><?php echo $total === 0 ? 'Sạch' : 'Tổng vấn đề'; ?></span>
    </div>
</div>

<?php if ($total === 0): ?>
    <div class="foxblock-fim-clean-msg">
        <span class="dashicons dashicons-shield"></span>
        Tuyệt vời! Tất cả các file trùng khớp hoàn toàn với Baseline.
        <div style="margin-top:15px;">
            <button class="button button-secondary foxblock-fim-rescan-btn" style="display:inline-flex;align-items:center;gap:5px;">
                <span class="dashicons dashicons-update-alt"></span> Kiểm tra lại ngay
            </button>
        </div>
    </div>
<?php else: ?>
    <div class="foxblock-table-responsive">
        <table class="foxblock-table">
            <thead>
                <tr>
                    <th style="width:110px">Trạng thái</th>
                    <th>Đường dẫn file</th>
                    <th style="width:160px">Thời gian sửa</th>
                </tr>
            </thead>
            <tbody>
                <?php foreach ($results['modified'] as $f): ?>
                <tr class="foxblock-fim-modified-row">
                    <td><span class="foxblock-fim-badge foxblock-fim-badge--modified">Đã sửa</span></td>
                    <td><code class="foxblock-fim-path"><?php echo esc_html($f['path']); ?></code></td>
                    <td class="foxblock-time"><?php echo esc_html($f['time']); ?></td>
                </tr>
                <?php endforeach; ?>
                <?php foreach ($results['added'] as $f): ?>
                <tr class="foxblock-fim-added-row">
                    <td><span class="foxblock-fim-badge foxblock-fim-badge--added">Thêm mới</span></td>
                    <td><code class="foxblock-fim-path"><?php echo esc_html($f['path']); ?></code></td>
                    <td class="foxblock-time"><?php echo esc_html($f['time']); ?></td>
                </tr>
                <?php endforeach; ?>
                <?php foreach ($results['deleted'] as $f): ?>
                <tr class="foxblock-fim-deleted-row">
                    <td><span class="foxblock-fim-badge foxblock-fim-badge--deleted">Đã xóa</span></td>
                    <td><code class="foxblock-fim-path"><?php echo esc_html($f['path']); ?></code></td>
                    <td class="foxblock-time"><?php echo esc_html($f['time']); ?></td>
                </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
    </div>
    <div class="foxblock-fim-action-container">
        <h3 style="margin-top:0;font-size:15px;color:#1d2327;">Bạn vừa cài mới hoặc cập nhật Plugin / Theme / WordPress?</h3>
        <p style="margin-bottom:15px;font-size:14px;color:#50575e;">Nếu các thay đổi trên là do bạn chủ động thực hiện, hãy nhấn nút bên dưới để chấp nhận và lưu Baseline mới.</p>
        <div style="display:flex;gap:10px;">
            <button id="foxblock-fim-update-btn" class="button button-primary" style="display:inline-flex;align-items:center;gap:5px;">
                <span class="dashicons dashicons-saved"></span> Cập nhật Baseline (Chấp nhận thay đổi)
            </button>
            <button class="button button-secondary foxblock-fim-rescan-btn" style="display:inline-flex;align-items:center;gap:5px;">
                <span class="dashicons dashicons-update-alt"></span> Kiểm tra lại
            </button>
        </div>
    </div>
<?php endif; ?>
