<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="styles/report.css">
    <title>Coverage Report — {{ company_name }}</title>
</head>
<body>
    <section class="cover-page">
        <img src="assets/logo.svg" class="logo" alt="Logo">
        <h1>MITRE ATT&amp;CK Coverage Report</h1>
        <h2>{{ company_name }}</h2>
        <p class="date">{{ generated_at }}</p>
        <p class="classification">{{ classification | default('INTERNAL') }}</p>
    </section>

    <section>
        <h2>1. Organization Score</h2>
        <div class="stats-grid">
            <div class="stat">
                <span class="number">{{ org_score.overall | default(0) }}%</span>
                <span class="label">Overall Score</span>
            </div>
            <div class="stat">
                <span class="number">{{ org_score.coverage | default(0) }}%</span>
                <span class="label">Coverage</span>
            </div>
            <div class="stat">
                <span class="number">{{ org_score.detection_maturity | default(0) }}%</span>
                <span class="label">Detection Maturity</span>
            </div>
        </div>
    </section>

    <section>
        <h2>2. Coverage Summary</h2>
        <div class="metric-cards">
            <div class="metric-card">
                <div class="value">{{ summary.total_techniques }}</div>
                <div class="label">Total Techniques</div>
            </div>
            <div class="metric-card">
                <div class="value">{{ summary.validated }}</div>
                <div class="label">Validated</div>
            </div>
            <div class="metric-card">
                <div class="value">{{ summary.partial }}</div>
                <div class="label">Partial</div>
            </div>
            <div class="metric-card">
                <div class="value">{{ summary.not_covered }}</div>
                <div class="label">Not Covered</div>
            </div>
            <div class="metric-card">
                <div class="value">{{ summary.in_progress }}</div>
                <div class="label">In Progress</div>
            </div>
            <div class="metric-card">
                <div class="value">{{ summary.not_evaluated }}</div>
                <div class="label">Not Evaluated</div>
            </div>
        </div>
    </section>

    <section>
        <h2>3. Coverage by Tactic</h2>
        <table class="data-table">
            <thead>
                <tr>
                    <th>Tactic</th>
                    <th>Total</th>
                    <th>Validated</th>
                    <th>Coverage %</th>
                </tr>
            </thead>
            <tbody>
            {% for tactic in tactics_coverage %}
                <tr>
                    <td>{{ tactic.tactic }}</td>
                    <td>{{ tactic.total }}</td>
                    <td>{{ tactic.validated }}</td>
                    <td>{{ tactic.coverage_pct }}%</td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </section>

    <section>
        <h2>4. Never-Tested Techniques</h2>
        {% if never_tested %}
        <table class="data-table">
            <thead>
                <tr>
                    <th>MITRE ID</th>
                    <th>Name</th>
                    <th>Tactic</th>
                </tr>
            </thead>
            <tbody>
            {% for t in never_tested %}
                <tr>
                    <td>{{ t.mitre_id }}</td>
                    <td>{{ t.name }}</td>
                    <td>{{ t.tactic }}</td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
        {% else %}
        <p>All techniques have been tested at least once.</p>
        {% endif %}
    </section>

    <footer>
        <p>{{ company_name }} — Confidential</p>
    </footer>
</body>
</html>
