<!-- Sidebar -->
<aside class="pkg-sidebar">

    <!-- Build status -->
    <div class="card sidebar-card">
        <div class="sidebar-card-title">Latest Build</div>
        <div class="sidebar-card-body">
            <div class="build-status-row">
                {% if package.meta.latest_build_status == "success" %}
                    <span class="badge badge-success"><span class="dot"></span>passing</span>
                {% elif package.meta.latest_build_status == "failure" %}
                    <span class="badge badge-failure"><span class="dot"></span>failing</span>
                {% elif package.meta.latest_build_status == "running" %}
                    <span class="badge badge-running"><span class="dot dot-pulse"></span>running</span>
                {% elif package.meta.latest_build_status == "pending" %}
                    <span class="badge badge-pending"><span class="dot"></span>pending</span>
                {% else %}
                    <span class="dim small">No builds yet</span>
                {% endif %}
            </div>
            {% if package.meta.latest_build_id %}
            <a class="build-link" href="/packages/{{ package.config.name }}/~artifact/{{ package.meta.latest_build_id }}">
                #{{ package.meta.latest_build_id }} — view logs →
            </a>
            {% endif %}
            {% if package.meta.latest_build_date %}
            <div class="dim small mono" style="margin-top:6px">{{ package.meta.latest_build_date }}</div>
            {% endif %}
        </div>
    </div>

    <!-- About -->
    <div class="card sidebar-card">
        <div class="sidebar-card-title">About</div>
        <div class="sidebar-card-body">
            {% if package.language %}
            <div class="sidebar-stat">
                <span class="sidebar-stat-label">Language</span>
                <span class="lang-pill">
                    <span class="lang-color-dot" {% if package.language_color %}style="background:{{ package.language_color }}"{% endif %}></span>
                    {{ package.language }}
                </span>
            </div>
            {% endif %}
            {% if package.version %}
            <div class="sidebar-stat">
                <span class="sidebar-stat-label">Version</span>
                <span class="sidebar-stat-value">{{ package.version }}</span>
            </div>
            {% endif %}
            {% if package.license %}
            <div class="sidebar-stat">
                <span class="sidebar-stat-label">License</span>
                <span class="sidebar-stat-value">{{ package.license }}</span>
            </div>
            {% endif %}
            {% if package.created_at %}
            <div class="sidebar-stat">
                <span class="sidebar-stat-label">Created</span>
                <span class="sidebar-stat-value dim">{{ package.created_at }}</span>
            </div>
            {% endif %}
        </div>
    </div>

    <!-- Quick links -->
    <div class="card sidebar-card">
        <div class="sidebar-card-title">Links</div>
        <div class="sidebar-card-body" style="display:flex;flex-direction:column;gap:6px">
            <a href="/packages/{{ package.config.name }}/~repo" style="font-size:13px">
                <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="vertical-align:middle;margin-right:4px"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>
                Browse files
            </a>
            <a href="/packages/{{ package.config.name }}/~artifact/" style="font-size:13px">
                <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="vertical-align:middle;margin-right:4px"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>
                Build history
            </a>
        </div>
    </div>

</aside>
