@extends('layouts.admin') @section('title', 'Demographics') @section('header', 'Demographics Analysis') @section('subheader', 'Engagement breakdown by department') @section('content') @include('company.partials.survey-selector') @include('company.partials.low-volume-warning')
@if($lowVolumeWarnings['show_demographics'] && count($departmentScores) > 0)

Department Engagement Scores

Only departments with 5+ responses are shown (anonymity protection)

@foreach(collect($departmentScores)->sortByDesc(fn($score) => $score) as $department => $score) @php $interpretation = \App\Models\Category::getScoreInterpretation($score); @endphp
{{ $department }}
@if($score > 20) {{ round($score) }}% @endif
{{ $interpretation['label'] }}
@endforeach

Visual Comparison

@push('scripts') @endpush @else

Demographics Not Available

@if(($analytics->total_responses ?? 0) < 5) Demographics analysis requires at least 5 total responses. @else No departments have enough responses (minimum 5) to display while protecting anonymity. @endif

@endif
@endsection