<div class="card">
    <div class="card-header border-0 pb-0 d-flex align-items-center justify-content-between">
        <div>
            <h4 class="card-title mb-0">AI Yönetici Yorumu</h4>
            <small class="text-muted">Risk, fırsat ve aksiyon önerileri</small>
        </div>
        @if($report->ai_generated_at)
            <span class="badge badge-light">{{ $report->ai_generated_at->format('d.m.Y H:i') }}</span>
        @endif
    </div>
    <div class="card-body">
        @if($report->ai_error_message)
            <div class="alert alert-warning py-2">{{ $report->ai_error_message }}</div>
        @endif

        @if($report->hasAiInsights())
            <div class="mb-4">
                <span class="text-muted d-block mb-1">Yönetici Özeti</span>
                <p class="mb-0">{{ $report->ai_executive_summary }}</p>
            </div>

            @if($report->ai_customer_note)
                <div class="alert alert-light border py-3">
                    <strong>Müşteri Notu:</strong> {{ $report->ai_customer_note }}
                </div>
            @endif

            <div class="row">
                <div class="col-md-6 mb-3">
                    <h6>Riskler</h6>
                    <ul class="mb-0">
                        @foreach(($report->ai_risks ?? []) as $item)
                            <li>{{ $item }}</li>
                        @endforeach
                    </ul>
                </div>
                <div class="col-md-6 mb-3">
                    <h6>Fırsatlar</h6>
                    <ul class="mb-0">
                        @foreach(($report->ai_opportunities ?? []) as $item)
                            <li>{{ $item }}</li>
                        @endforeach
                    </ul>
                </div>
            </div>

            <h6>Aksiyon Listesi</h6>
            <ol class="mb-3">
                @foreach(($report->ai_actions ?? []) as $item)
                    <li>{{ $item }}</li>
                @endforeach
            </ol>

            @if($report->ai_technical_note)
                <div class="text-muted small">Teknik not: {{ $report->ai_technical_note }}</div>
            @endif
        @else
            <div class="text-center text-muted py-4">
                Bu rapor için henüz AI yorumu üretilmedi.
            </div>
        @endif
    </div>
</div>
