<?php
/**
 * 247ChatMate — Agency Hub partial.
 * Checkpoint: AGENCYHUBRESPONSIBILITYSPLIT1
 *
 * Display-only split from admin/views/partials/agency-hub.php.
 * Expects parent Agency Hub variables to be prepared before include.
 */

defined('ABSPATH') || exit;
?>
    <section class="matewa-agency-hub-hero" aria-label="Agency account status">
        <div>
            <span class="matewa-agency-hub-kicker">Agency active</span>
            <h3>Agency plan live</h3>
            <p>Your agency site is unlocked. Add client licences when you’re ready to roll this out to customers.</p>
            <div class="matewa-agency-hub-hero-actions" aria-label="Agency licence purchase actions">
                <a class="button button-primary" href="<?php echo esc_url(function_exists('matewa_agency_bundle_get_default_checkout_url') ? matewa_agency_bundle_get_default_checkout_url() : 'https://247chatmate.lemonsqueezy.com/'); ?>" target="_blank" rel="noopener noreferrer">Buy client licences</a>
                <a class="button button-secondary" href="#matewa-agency-bundle-licences">Manage licences</a>
            </div>
        </div>
        <div class="matewa-agency-hub-status-pill" aria-label="Paid client seats available to this agency account">
            <strong><?php echo esc_html((string) $matewa_agency_available_seats); ?></strong>
            <span>client seats available</span>
        </div>
    </section>

    <section class="matewa-agency-hub-stats" aria-label="Agency portfolio snapshot">
        <article class="matewa-agency-hub-stat-card">
            <span>Seats used</span>
            <strong><?php echo esc_html((string) $matewa_agency_used_seats); ?> / <?php echo esc_html((string) $matewa_agency_client_seats); ?></strong>
            <small><?php echo esc_html((string) $matewa_agency_available_seats); ?> available</small>
        </article>
        <article class="matewa-agency-hub-stat-card">
            <span>Expiring soon</span>
            <strong><?php echo esc_html((string) $matewa_agency_expiring_soon); ?></strong>
            <small>Expiry alerts come later</small>
        </article>
        <article class="matewa-agency-hub-stat-card">
            <span>Setup packs</span>
            <strong><?php echo esc_html((string) $matewa_agency_setup_packs); ?></strong>
            <small><?php echo $matewa_agency_setup_packs > 0 ? esc_html('Manual packs saved') : esc_html('Manual packs next'); ?></small>
        </article>
        <article class="matewa-agency-hub-stat-card <?php echo $matewa_agency_needs_attention > 0 ? 'is-warning' : 'is-ready'; ?>">
            <span>Needs attention</span>
            <strong><?php echo esc_html((string) $matewa_agency_needs_attention); ?></strong>
            <small><?php echo esc_html($matewa_agency_client_stage_note); ?></small>
        </article>
    </section>
