@extends('layouts.app')
@section('title', 'Body-System Finding Catalogues')

@section('content')
<section class="content-header">
    <h1><i class="fa fa-list-ul"></i> Body-System Finding Catalogues
        <small>Per-system checklists on the Objective tab</small></h1>
    <ol class="breadcrumb">
        <li><a href="{{ route('vc.dashboard') }}">Vet Clinic</a></li>
        <li class="active">System Findings</li>
    </ol>
</section>

<section class="content">
    <div class="callout callout-info" style="font-size:12.5px;">
        These checklists appear on the Objective tab when the doctor marks a
        body system <strong>Abnormal</strong>. Each system has a system-default
        catalogue (read-only, ships with the module). Your clinic can add
        custom findings or override existing ones by inserting a row with the
        same <code>value</code>. Per-finding flags control whether severity
        (Mild/Mod/Severe), lateralisation (L/R), and critical-flagging appear.
    </div>

    @php
        $labels = [
            'heart'=>'Heart','lungs'=>'Lungs','eyes'=>'Eyes','ears'=>'Ears',
            'nose_throat'=>'Nose / Throat','mouth_teeth_gums'=>'Mouth / Teeth / Gums',
            'abdomen'=>'Abdomen','musculoskeletal'=>'Musculoskeletal',
            'skin_hair_coat'=>'Skin / Hair Coat','neurological'=>'Neurological',
        ];
    @endphp
    <div class="row">
        @foreach($labels as $key => $label)
            <div class="col-md-4 col-sm-6">
                <a href="{{ route('vc.system-findings.list', $key) }}" class="vc-card-link"
                   style="display:block;padding:14px 16px;border:1px solid #e2e8f0;border-radius:8px;margin-bottom:12px;text-decoration:none;color:#1e293b;background:#fff;">
                    <div style="font-weight:700;font-size:13px;margin-bottom:4px;">
                        <i class="fa fa-folder-open" style="color:#0ea5e9;"></i> {{ $label }}
                    </div>
                    <div style="font-size:11.5px;color:#64748b;">
                        <span class="label label-default">{{ $counts[$key]['system'] ?? 0 }} system</span>
                        @if(($counts[$key]['biz'] ?? 0) > 0)
                            <span class="label label-success">{{ $counts[$key]['biz'] }} business</span>
                        @endif
                    </div>
                </a>
            </div>
        @endforeach
    </div>
</section>
@endsection

@section('css')
<style>
.vc-card-link:hover { background:#f8fafc !important; border-color:#0ea5e9 !important; text-decoration:none !important; }
</style>
@endsection
