{{-- One box card: icon + name + designation on the left, 3 values on the right. --}} @php $role = auth()->user()->primaryRole(); $type = $node['type']; $pct = $node['compliance']; $none = $node['total'] == 0; $accent = $none ? '#8A9199' : ($node['overdue'] > 0 ? '#C1473A' : ($pct >= 100 ? '#0E7C7B' : '#B08D57')); $flag = ! $none && $pct < 80; // non-compliant when below 80% $showToggle = ($showToggle ?? false) && ! empty($node['children']); $icon = match ($type === 'home' ? 'home' : ($node['role_key'] ?? '')) { 'ceo' => 'workspace_premium', 'coo' => 'manage_accounts', 'head_of_operations' => 'hub', 'registered_manager' => 'supervisor_account', 'service_manager' => 'badge', 'home' => 'cottage', default => 'person', }; @endphp