@extends('layouts.app')
@section('title','Audit Log Detail - NGBVD')
@section('content')
<style>
.ngbvd-page-header{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;background:linear-gradient(135deg,#fff,#fff8ea);border:1px solid #efe4ca;border-radius:18px;padding:18px 20px;margin-bottom:18px;box-shadow:0 10px 28px rgba(15,23,42,.05)}.ngbvd-kicker{display:block;color:#9a6514;font-size:11px;text-transform:uppercase;letter-spacing:.08em;font-weight:800;margin-bottom:4px}.ngbvd-page-title{margin:0;color:#1f2937;font-weight:800}.ngbvd-page-subtitle{margin:4px 0 0;color:#64748b}.ngbvd-form-card{border:0;border-radius:18px;box-shadow:0 14px 36px rgba(15,23,42,.08);overflow:hidden;background:#fff}.ngbvd-form-card .card-block{padding:22px}.ngbvd-detail-grid label{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:#94a3b8;font-weight:800;margin-bottom:2px}.ngbvd-detail-grid p{font-weight:700;color:#1f2937;word-break:break-word}.ngbvd-code-panel{border:1px solid #e7edf5;border-radius:14px;overflow:hidden;background:#0f172a}.ngbvd-code-panel-title{padding:10px 14px;background:#f8fafc;color:#334155;font-weight:800;border-bottom:1px solid #e7edf5}.ngbvd-code-panel pre{margin:0;padding:14px;color:#dbeafe;white-space:pre-wrap;max-height:420px;overflow:auto}
</style>
<div class="ngbvd-page-header">
    <div>
        <span class="ngbvd-kicker">Audit Record</span>
        <h2 class="ngbvd-page-title">Audit Log Detail</h2>
        <p class="ngbvd-page-subtitle">Detailed activity record for governance and accountability review.</p>
    </div>
    <div><a href="{{ url('/audit/logs') }}" class="btn ngbvd-btn-soft"><i class="ti-arrow-left"></i> Back to Audit Logs</a></div>
</div>
<div class="card ngbvd-form-card">
    <div class="card-block">
        <div class="row ngbvd-detail-grid">
            <div class="col-md-4"><label>User</label><p>{{ $log->user_email ?: 'System' }}</p></div>
            <div class="col-md-4"><label>Date / Time</label><p>{{ optional($log->created_at)->format('d M Y H:i:s') }}</p></div>
            <div class="col-md-4"><label>Status</label><p>{{ ucfirst($log->status ?? 'recorded') }} @if($log->response_code) / {{ $log->response_code }} @endif</p></div>
            <div class="col-md-4"><label>Module</label><p>{{ $log->module ?: 'General' }}</p></div>
            <div class="col-md-4"><label>Action</label><p>{{ $log->action ?: 'Activity' }}</p></div>
            <div class="col-md-4"><label>Method</label><p>{{ $log->method ?: 'N/A' }}</p></div>
            <div class="col-md-4"><label>IP Address</label><p>{{ $log->ip_address ?: 'Not captured' }}</p></div>
            <div class="col-md-4"><label>Role</label><p>{{ $log->role ?: 'Not captured' }}</p></div>
            <div class="col-md-12"><label>Requested Resource</label><p>{{ $log->url ?: 'Not captured' }}</p></div>
            <div class="col-md-12"><label>User Agent</label><p>{{ $log->user_agent ?: 'Not captured' }}</p></div>
        </div>
        <div class="ngbvd-code-panel mt-3"><div class="ngbvd-code-panel-title">Request Payload</div><pre>{{ $log->request_payload ?: 'No payload captured for this activity.' }}</pre></div>
    </div>
</div>
@endsection
